Skip to content

Commit

Permalink
Implemented macOS version
Browse files Browse the repository at this point in the history
  • Loading branch information
golosio committed Mar 7, 2020
1 parent a810ef7 commit 903c16a
Show file tree
Hide file tree
Showing 28 changed files with 4,812 additions and 121 deletions.
674 changes: 674 additions & 0 deletions COPYING

Large diffs are not rendered by default.

368 changes: 368 additions & 0 deletions INSTALL

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,9 @@ DIST_SUBDIRS = $(SUBDIRS)
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \
$(top_srcdir)/m4/compile $(top_srcdir)/m4/config.guess \
$(top_srcdir)/m4/config.sub $(top_srcdir)/m4/install-sh \
$(top_srcdir)/m4/ltmain.sh $(top_srcdir)/m4/missing m4/compile \
m4/config.guess m4/config.sub m4/depcomp m4/install-sh \
m4/ltmain.sh m4/missing m4/py-compile
$(top_srcdir)/m4/ltmain.sh $(top_srcdir)/m4/missing COPYING \
INSTALL m4/compile m4/config.guess m4/config.sub m4/depcomp \
m4/install-sh m4/ltmain.sh m4/missing m4/py-compile
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
Expand Down Expand Up @@ -341,7 +341,6 @@ program_transform_name = @program_transform_name@
psdir = @psdir@
pyexecdir = @pyexecdir@
pythondir = @pythondir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
Expand Down
79 changes: 17 additions & 62 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,6 @@ infodir
docdir
oldincludedir
includedir
runstatedir
localstatedir
sharedstatedir
sysconfdir
Expand Down Expand Up @@ -846,7 +845,6 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
Expand Down Expand Up @@ -1099,15 +1097,6 @@ do
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;

-runstatedir | --runstatedir | --runstatedi | --runstated \
| --runstate | --runstat | --runsta | --runst | --runs \
| --run | --ru | --r)
ac_prev=runstatedir ;;
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
| --run=* | --ru=* | --r=*)
runstatedir=$ac_optarg ;;

-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
Expand Down Expand Up @@ -1245,7 +1234,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
libdir localedir mandir runstatedir
libdir localedir mandir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
Expand Down Expand Up @@ -1398,7 +1387,6 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
Expand Down Expand Up @@ -4695,7 +4683,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
lt_cv_deplibs_check_method=pass_all
;;

netbsd* | netbsdelf*-gnu)
netbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
else
Expand Down Expand Up @@ -5601,8 +5589,11 @@ _LT_EOF
test $ac_status = 0; }; then
# Now try to grab the symbols.
nlist=conftest.nm
$ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&5
if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&5 && test -s "$nlist"; then
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
(eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && test -s "$nlist"; then
# Try sorting and uniquifying the output.
if sort "$nlist" | uniq > "$nlist"T; then
mv -f "$nlist"T "$nlist"
Expand Down Expand Up @@ -7891,12 +7882,6 @@ lt_prog_compiler_static=
lt_prog_compiler_pic='-KPIC'
lt_prog_compiler_static='-static'
;;
# flang / f18. f95 an alias for gfortran or flang on Debian
flang* | f18* | f95*)
lt_prog_compiler_wl='-Wl,'
lt_prog_compiler_pic='-fPIC'
lt_prog_compiler_static='-static'
;;
# icc used to be incompatible with GCC.
# ICC 10 doesn't accept -KPIC any more.
icc* | ifort*)
Expand Down Expand Up @@ -8373,9 +8358,6 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
openbsd* | bitrig*)
with_gnu_ld=no
;;
linux* | k*bsd*-gnu | gnu*)
link_all_deplibs=no
;;
esac

ld_shlibs=yes
Expand Down Expand Up @@ -8630,7 +8612,7 @@ _LT_EOF
fi
;;

netbsd* | netbsdelf*-gnu)
netbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
wlarc=
Expand Down Expand Up @@ -9300,7 +9282,6 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
if test yes = "$lt_cv_irix_exported_symbol"; then
archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
fi
link_all_deplibs=no
else
archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
Expand All @@ -9322,7 +9303,7 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
esac
;;

netbsd* | netbsdelf*-gnu)
netbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
else
Expand Down Expand Up @@ -10437,18 +10418,6 @@ fi
dynamic_linker='GNU/Linux ld.so'
;;

netbsdelf*-gnu)
version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
dynamic_linker='NetBSD ld.elf_so'
;;

netbsd*)
version_type=sunos
need_lib_prefix=no
Expand Down Expand Up @@ -13455,7 +13424,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'

else
GXX=no
Expand Down Expand Up @@ -13947,7 +13916,7 @@ fi
# explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library
# dependencies.
output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
;;
*)
if test yes = "$GXX"; then
Expand Down Expand Up @@ -14012,7 +13981,7 @@ fi
# explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library
# dependencies.
output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
;;
*)
if test yes = "$GXX"; then
Expand Down Expand Up @@ -14351,7 +14320,7 @@ fi
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'

else
# FIXME: insert proper C++ library support
Expand Down Expand Up @@ -14435,7 +14404,7 @@ fi
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
else
# g++ 2.7 appears to require '-G' NOT '-shared' on this
# platform.
Expand All @@ -14446,7 +14415,7 @@ fi
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
fi

hardcode_libdir_flag_spec_CXX='$wl-R $wl$libdir'
Expand Down Expand Up @@ -14959,7 +14928,7 @@ lt_prog_compiler_static_CXX=
;;
esac
;;
netbsd* | netbsdelf*-gnu)
netbsd*)
;;
*qnx* | *nto*)
# QNX uses GNU C++, but need to define -shared option too, otherwise
Expand Down Expand Up @@ -15334,9 +15303,6 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
;;
esac
;;
linux* | k*bsd*-gnu | gnu*)
link_all_deplibs_CXX=no
;;
*)
export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
;;
Expand Down Expand Up @@ -16030,18 +15996,6 @@ fi
dynamic_linker='GNU/Linux ld.so'
;;

netbsdelf*-gnu)
version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
dynamic_linker='NetBSD ld.elf_so'
;;

netbsd*)
version_type=sunos
need_lib_prefix=no
Expand Down Expand Up @@ -19078,6 +19032,7 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
cat <<_LT_EOF >> "$cfgfile"
#! $SHELL
# Generated automatically by $as_me ($PACKAGE) $VERSION
# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
# NOTE: Changes made to this file will be lost: look at ltmain.sh.

# Provide generalized library-building support services.
Expand Down
10 changes: 9 additions & 1 deletion patch.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
cd src
echo "Patch to Makefile.in link command for compiling and linking in one step"
file_list=$(echo $(ls ../$ac_top_srcdir/src/*.cu ../$ac_top_srcdir/src/*.cpp | grep -v dummyfile.cpp)) #| xargs -n 1 basename))
escaped_rhs=$(echo "$file_list" | sed 's:[\/&]:\\&:g;$!s/$/\\/')
cat ../$ac_top_srcdir/src/Makefile.in | sed 's/$(AM_V_CXXLD)$(/$(NVCC) -ccbin=$(MPICXX) --compiler-options "${COMPILER_FLAGS}" -I .. ${CUDA_FLAGS} ${CUDA_LDFLAGS} -o libneurongpu.so $(all_SOURCES) $(CUDA_LIBS)\n# $(AM_V_CXXLD)$(/' | sed "/libneurongpu_la_SOURCES =/ a all_SOURCES = $escaped_rhs" | sed 's/libneurongpu.la/libneurongpu.so/'> tmpfile
cat ../$ac_top_srcdir/src/Makefile.in | sed 's/$(AM_V_CXXLD)$(/$(NVCC) -ccbin=$(MPICXX) --compiler-options "${COMPILER_FLAGS}" -I .. ${CUDA_FLAGS} ${CUDA_LDFLAGS} -o libneurongpu.so $(all_SOURCES) $(CUDA_LIBS) \
# $(AM_V_CXXLD)$(/' | sed "/libneurongpu_la_SOURCES =/ a\\
all_SOURCES = $escaped_rhs \\
" | sed 's/libneurongpu.la/libneurongpu.so/'> tmpfile
mv tmpfile ../$ac_top_srcdir/src/Makefile.in
cd ..
#Becho "libtool postinstall_cmds patch for correcting @rpath in libneurongpu.so"
#sed 's|postinstall_cmds=""|postinstall_cmds="./postinstall.sh"|g' libtool > libtool.fixed
#Bcp -f libtool.fixed libtool
#chmod +x libtool
6 changes: 6 additions & 0 deletions patch_linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
cd src
file_list=$(echo $(ls ../$ac_top_srcdir/src/*.cu ../$ac_top_srcdir/src/*.cpp | grep -v dummyfile.cpp)) #| xargs -n 1 basename))
escaped_rhs=$(echo "$file_list" | sed 's:[\/&]:\\&:g;$!s/$/\\/')
cat ../$ac_top_srcdir/src/Makefile.in | sed 's/$(AM_V_CXXLD)$(/$(NVCC) -ccbin=$(MPICXX) --compiler-options "${COMPILER_FLAGS}" -I .. ${CUDA_FLAGS} ${CUDA_LDFLAGS} -o libneurongpu.so $(all_SOURCES) $(CUDA_LIBS)\n# $(AM_V_CXXLD)$(/' | sed "/libneurongpu_la_SOURCES =/ a all_SOURCES = $escaped_rhs" | sed 's/libneurongpu.la/libneurongpu.so/'> tmpfile
mv tmpfile ../$ac_top_srcdir/src/Makefile.in
cd ..
14 changes: 14 additions & 0 deletions patch_macOS.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
cd src
echo "Patch to Makefile.in link command for compiling and linking in one step"
file_list=$(echo $(ls ../$ac_top_srcdir/src/*.cu ../$ac_top_srcdir/src/*.cpp | grep -v dummyfile.cpp)) #| xargs -n 1 basename))
escaped_rhs=$(echo "$file_list" | sed 's:[\/&]:\\&:g;$!s/$/\\/')
cat ../$ac_top_srcdir/src/Makefile.in | sed 's/$(AM_V_CXXLD)$(/$(NVCC) -ccbin=$(MPICXX) --compiler-options "${COMPILER_FLAGS}" -I .. ${CUDA_FLAGS} ${CUDA_LDFLAGS} -o libneurongpu.so $(all_SOURCES) $(CUDA_LIBS) \
# $(AM_V_CXXLD)$(/' | sed "/libneurongpu_la_SOURCES =/ a\\
all_SOURCES = $escaped_rhs \\
" | sed 's/libneurongpu.la/libneurongpu.so/'> tmpfile
mv tmpfile ../$ac_top_srcdir/src/Makefile.in
cd ..
#Becho "libtool postinstall_cmds patch for correcting @rpath in libneurongpu.so"
#sed 's|postinstall_cmds=""|postinstall_cmds="./postinstall.sh"|g' libtool > libtool.fixed
#Bcp -f libtool.fixed libtool
#chmod +x libtool
3 changes: 3 additions & 0 deletions postinstall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
echo "libtool running postinstall.sh"
install_name_tool -change @rpath/usr/local/lib/ /usr/local/lib/libcurand.10.dylib /usr/local/lib/libneurongpu.so
3 changes: 1 addition & 2 deletions pythonlib/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ am__uninstall_files_from_dir = { \
am__py_compile = PYTHON=$(PYTHON) $(SHELL) $(py_compile)
am__installdirs = "$(DESTDIR)$(pythondir)"
am__pep3147_tweak = \
sed -e 's|\.py$$||' -e 's|[^/]*$$|&.*.pyc\n&.*.pyo|'
sed -e 's|\.py$$||' -e 's|[^/]*$$|&.*.pyc &.*.pyo|'
py_compile = $(top_srcdir)/m4/py-compile
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/m4/py-compile
Expand Down Expand Up @@ -286,7 +286,6 @@ program_transform_name = @program_transform_name@
psdir = @psdir@
pyexecdir = @pyexecdir@
pythondir = @pythondir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
Expand Down
2 changes: 1 addition & 1 deletion pythonlib/neurongpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import ctypes, ctypes.util
import os

lib_path="libneurongpu.so"
lib_path="/usr/local/lib/libneurongpu.so"
_neurongpu=ctypes.CDLL(lib_path)

c_float_p = ctypes.POINTER(ctypes.c_float)
Expand Down
Loading

0 comments on commit 903c16a

Please sign in to comment.