Skip to content

Commit 4806e09

Browse files
committed
fixes for mac compile
1 parent a4cd6a5 commit 4806e09

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

jni/src/BIDMach_CPUMACH.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ JNIEXPORT jdouble JNICALL Java_edu_berkeley_bid_CPUMACH_word2vecEvalPos
276276
cv = cv / (1.0f + cv);
277277
}
278278

279-
dv += log(max((double)cv, 1.0e-40));
279+
dv += log(fmax((double)cv, 1.0e-40));
280280
}
281281
}
282282
}
@@ -346,7 +346,7 @@ JNIEXPORT jdouble JNICALL Java_edu_berkeley_bid_CPUMACH_word2vecEvalNeg
346346
cv = exp(cv);
347347
cv = cv / (1.0f + cv);
348348
}
349-
dv += log(max(1.0 - (double)cv, 1.0e-40));
349+
dv += log(fmax(1.0 - (double)cv, 1.0e-40));
350350
}
351351
}
352352
}

jni/src/configure

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ if [ "$OS" = "apple" ] ; then
6060
JAVA_HOME=`/usr/libexec/java_home`
6161
fi
6262
CUDA_HOME="/usr/local/cuda"
63-
CC="gcc"
63+
CC="icc"
6464
GCC="g++"
6565
NVCC="nvcc"
6666
NVCCFLAGS="-c -ccbin=clang -use_fast_math -I$BIDMACH_ROOT/jni/include \
@@ -72,9 +72,9 @@ if [ "$OS" = "apple" ] ; then
7272
OBJ="o"
7373
OUTFLG="-o "
7474
CPPFLAGS="-fPIC -c -O2 -g -DNDEBUG -I$JAVA_HOME/include -I$JAVA_HOME/include/darwin -I$BIDMACH_ROOT/jni/include -I$CUDA_HOME/include"
75-
CFLAGS="-fPIC -c -O2 -g -DNDEBUG -I$JAVA_HOME/include -I$JAVA_HOME/include/darwin -I$MKL_ROOT/include -I$MKL_ROOT/include/${ARCHD}${SUBDIR}"
75+
CFLAGS="-openmp -fPIC -c -O2 -g -DNDEBUG -I$JAVA_HOME/include -I$JAVA_HOME/include/darwin -I$MKL_ROOT/include -I$MKL_ROOT/include/${ARCHD}${SUBDIR}"
7676
LB="ar rc"
77-
LD="g++ -shared"
77+
LD="icc -dynamiclib"
7878
GLD="nvcc -shared -Xlinker -rpath -Xlinker ${CUDA_HOME}/lib -lstdc++"
7979
LDFLAGS="$LDFLAGS"
8080
LIBPREPEND="lib"

0 commit comments

Comments
 (0)