ccsb-scripps / AutoDock-Vina

AutoDock Vina
http://vina.scripps.edu
Apache License 2.0
614 stars 211 forks source link

compile in macOS chip M1 #84

Open hotwa opened 2 years ago

hotwa commented 2 years ago

some error I install brew install gcc boost try to make get this error

`

make aarch64-apple-darwin21-g++-11 -static -pthread -ansi -Wno-long-long -O3 -DNDEBUG -std=c++11 -DVERSION=\"v1.2.3-3-gd913876-mod\" -I /opt/homebrew/Cellar/boost/1.76.0/include -I ../../../src/lib -o main.o -c ../../../src/main/main.cpp aarch64-apple-darwin21-g++-11 -static -pthread -ansi -Wno-long-long -O3 -DNDEBUG -std=c++11 -DVERSION=\"v1.2.3-3-gd913876-mod\" -I /opt/homebrew/Cellar/boost/1.76.0/include -o ad4cache.o -c ../../../src/lib/ad4cache.cpp aarch64-apple-darwin21-g++-11 -static -pthread -ansi -Wno-long-long -O3 -DNDEBUG -std=c++11 -DVERSION=\"v1.2.3-3-gd913876-mod\" -I /opt/homebrew/Cellar/boost/1.76.0/include -o cache.o -c ../../../src/lib/cache.cpp aarch64-apple-darwin21-g++-11 -static -pthread -ansi -Wno-long-long -O3 -DNDEBUG -std=c++11 -DVERSION=\"v1.2.3-3-gd913876-mod\" -I /opt/homebrew/Cellar/boost/1.76.0/include -o non_cache.o -c ../../../src/lib/non_cache.cpp aarch64-apple-darwin21-g++-11 -static -pthread -ansi -Wno-long-long -O3 -DNDEBUG -std=c++11 -DVERSION=\"v1.2.3-3-gd913876-mod\" -I /opt/homebrew/Cellar/boost/1.76.0/include -o conf_independent.o -c ../../../src/lib/conf_independent.cpp aarch64-apple-darwin21-g++-11 -static -pthread -ansi -Wno-long-long -O3 -DNDEBUG -std=c++11 -DVERSION=\"v1.2.3-3-gd913876-mod\" -I /opt/homebrew/Cellar/boost/1.76.0/include -o coords.o -c ../../../src/lib/coords.cpp aarch64-apple-darwin21-g++-11 -static -pthread -ansi -Wno-long-long -O3 -DNDEBUG -std=c++11 -DVERSION=\"v1.2.3-3-gd913876-mod\" -I /opt/homebrew/Cellar/boost/1.76.0/include -o grid.o -c ../../../src/lib/grid.cpp aarch64-apple-darwin21-g++-11 -static -pthread -ansi -Wno-long-long -O3 -DNDEBUG -std=c++11 -DVERSION=\"v1.2.3-3-gd913876-mod\" -I /opt/homebrew/Cellar/boost/1.76.0/include -o szv_grid.o -c ../../../src/lib/szv_grid.cpp aarch64-apple-darwin21-g++-11 -static -pthread -ansi -Wno-long-long -O3 -DNDEBUG -std=c++11 -DVERSION=\"v1.2.3-3-gd913876-mod\" -I /opt/homebrew/Cellar/boost/1.76.0/include -o model.o -c ../../../src/lib/model.cpp aarch64-apple-darwin21-g++-11 -static -pthread -ansi -Wno-long-long -O3 -DNDEBUG -std=c++11 -DVERSION=\"v1.2.3-3-gd913876-mod\" -I /opt/homebrew/Cellar/boost/1.76.0/include -o monte_carlo.o -c ../../../src/lib/monte_carlo.cpp aarch64-apple-darwin21-g++-11 -static -pthread -ansi -Wno-long-long -O3 -DNDEBUG -std=c++11 -DVERSION=\"v1.2.3-3-gd913876-mod\" -I /opt/homebrew/Cellar/boost/1.76.0/include -o mutate.o -c ../../../src/lib/mutate.cpp aarch64-apple-darwin21-g++-11 -static -pthread -ansi -Wno-long-long -O3 -DNDEBUG -std=c++11 -DVERSION=\"v1.2.3-3-gd913876-mod\" -I /opt/homebrew/Cellar/boost/1.76.0/include -o parallel_mc.o -c ../../../src/lib/parallel_mc.cpp In file included from /opt/homebrew/Cellar/boost/1.76.0/include/boost/smart_ptr/detail/sp_thread_sleep.hpp:22, from /opt/homebrew/Cellar/boost/1.76.0/include/boost/smart_ptr/detail/yield_k.hpp:23, from /opt/homebrew/Cellar/boost/1.76.0/include/boost/smart_ptr/detail/spinlock_gcc_atomic.hpp:14, from /opt/homebrew/Cellar/boost/1.76.0/include/boost/smart_ptr/detail/spinlock.hpp:42, from /opt/homebrew/Cellar/boost/1.76.0/include/boost/smart_ptr/detail/spinlock_pool.hpp:25, from /opt/homebrew/Cellar/boost/1.76.0/include/boost/smart_ptr/shared_ptr.hpp:29, from /opt/homebrew/Cellar/boost/1.76.0/include/boost/shared_ptr.hpp:17, from /opt/homebrew/Cellar/boost/1.76.0/include/boost/date_time/time_clock.hpp:17, from /opt/homebrew/Cellar/boost/1.76.0/include/boost/thread/thread_time.hpp:9, from /opt/homebrew/Cellar/boost/1.76.0/include/boost/thread/lock_types.hpp:18, from /opt/homebrew/Cellar/boost/1.76.0/include/boost/thread/pthread/thread_data.hpp:12, from /opt/homebrew/Cellar/boost/1.76.0/include/boost/thread/thread_only.hpp:17, from /opt/homebrew/Cellar/boost/1.76.0/include/boost/thread/thread.hpp:12, from ../../../src/lib/parallel.h:31, from ../../../src/lib/parallel_mc.cpp:23: /opt/homebrew/Cellar/boost/1.76.0/include/boost/config/pragma_message.hpp:24:34 note: '#pragma message: This header is deprecated. Use the facilities in <boost/timer/timer.hpp> or <boost/timer/progress_display.hpp> instead.' 24 | # define BOOST_PRAGMA_MESSAGE(x) _Pragma(BOOST_STRINGIZE(message(x))) | ^~~ /opt/homebrew/Cellar/boost/1.76.0/include/boost/config/header_deprecated.hpp:23:37: note: in expansion of macro 'BOOST_PRAGMA_MESSAGE' 23 | # define BOOST_HEADER_DEPRECATED(a) BOOST_PRAGMA_MESSAGE("This header is deprecated. Use " a " instead.") | ^~~~~~~~ /opt/homebrew/Cellar/boost/1.76.0/include/boost/progress.hpp:23:1: note: in expansion of macro 'BOOST_HEADER_DEPRECATED' 23 | BOOST_HEADER_DEPRECATED( "the facilities in <boost/timer/timer.hpp> or <boost/timer/progress_display.hpp>" ) | ^~~~~~~ /opt/homebrew/Cellar/boost/1.76.0/include/boost/config/pragma_message.hpp:24:34 note: '#pragma message: This header is deprecated. Use the facilities in <boost/timer/timer.hpp> instead.' 24 | # define BOOST_PRAGMA_MESSAGE(x) _Pragma(BOOST_STRINGIZE(message(x))) | ^~~ /opt/homebrew/Cellar/boost/1.76.0/include/boost/config/header_deprecated.hpp:23:37: note: in expansion of macro 'BOOST_PRAGMA_MESSAGE' 23 | # define BOOST_HEADER_DEPRECATED(a) BOOST_PRAGMA_MESSAGE("This header is deprecated. Use " a " instead.") | ^~~~~~~~ /opt/homebrew/Cellar/boost/1.76.0/include/boost/timer.hpp:21:1: note: in expansion of macro 'BOOST_HEADER_DEPRECATED' 21 | BOOST_HEADER_DEPRECATED( "the facilities in <boost/timer/timer.hpp>" ) | ^~~~~~~ aarch64-apple-darwin21-g++-11 -static -pthread -ansi -Wno-long-long -O3 -DNDEBUG -std=c++11 -DVERSION=\"v1.2.3-3-gd913876-mod\" -I /opt/homebrew/Cellar/boost/1.76.0/include -o parse_pdbqt.o -c ../../../src/lib/parse_pdbqt.cpp aarch64-apple-darwin21-g++-11 -static -pthread -ansi -Wno-long-long -O3 -DNDEBUG -std=c++11 -DVERSION=\"v1.2.3-3-gd913876-mod\" -I /opt/homebrew/Cellar/boost/1.76.0/include -o quasi_newton.o -c ../../../src/lib/quasi_newton.cpp aarch64-apple-darwin21-g++-11 -static -pthread -ansi -Wno-long-long -O3 -DNDEBUG -std=c++11 -DVERSION=\"v1.2.3-3-gd913876-mod\" -I /opt/homebrew/Cellar/boost/1.76.0/include -o quaternion.o -c ../../../src/lib/quaternion.cpp aarch64-apple-darwin21-g++-11 -static -pthread -ansi -Wno-long-long -O3 -DNDEBUG -std=c++11 -DVERSION=\"v1.2.3-3-gd913876-mod\" -I /opt/homebrew/Cellar/boost/1.76.0/include -o random.o -c ../../../src/lib/random.cpp aarch64-apple-darwin21-g++-11 -static -pthread -ansi -Wno-long-long -O3 -DNDEBUG -std=c++11 -DVERSION=\"v1.2.3-3-gd913876-mod\" -I /opt/homebrew/Cellar/boost/1.76.0/include -o utils.o -c ../../../src/lib/utils.cpp aarch64-apple-darwin21-g++-11 -static -pthread -ansi -Wno-long-long -O3 -DNDEBUG -std=c++11 -DVERSION=\"v1.2.3-3-gd913876-mod\" -I /opt/homebrew/Cellar/boost/1.76.0/include -o vina.o -c ../../../src/lib/vina.cpp aarch64-apple-darwin21-g++-11 -static -pthread -ansi -Wno-long-long -O3 -DNDEBUG -std=c++11 -DVERSION=\"v1.2.3-3-gd913876-mod\" -I /opt/homebrew/Cellar/boost/1.76.0/include -L/opt/homebrew/Cellar/boost/1.76.0/lib -L. -o vina main.o ad4cache.o cache.o non_cache.o conf_independent.o coords.o grid.o szv_grid.o model.o monte_carlo.o mutate.o parallel_mc.o parse_pdbqt.o quasi_newton.o quaternion.o random.o utils.o vina.o -l boost_system -l boost_thread -l boost_serialization -l boost_filesystem -l boost_program_options ld: library not found for -lcrt0.o collect2: error: ld returned 1 exit status make: *** [vina] Error 1 `

hotwa commented 2 years ago

Makefile ` BASE=/opt/homebrew/Cellar/boost/1.76.0 BOOST_VERSION= BOOST_INCLUDE = $(BASE)/include C_PLATFORM=-static -pthread GPP=aarch64-apple-darwin21-g++-11 C_OPTIONS= -O3 -DNDEBUG -std=c++11 BOOST_LIB_VERSION=

include ../../makefile_common `

philspence commented 2 years ago

Not sure if this helps but I managed to compile it on an M1 Mac by changing my Makefile to:

` BASE=/opt/homebrew BOOST_VERSION= BOOST_INCLUDE = $(BASE)/include C_PLATFORM=-pthread GPP=/usr/bin/clang++ C_OPTIONS= -O3 -DNDEBUG -std=c++11 BOOST_LIB_VERSION=

include ../../makefile_common `