Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compile in macOS chip M1 #84

Closed
hotwa opened this issue Feb 3, 2022 · 3 comments
Closed

compile in macOS chip M1 #84

hotwa opened this issue Feb 3, 2022 · 3 comments

Comments

@hotwa
Copy link

hotwa commented Feb 3, 2022

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
Copy link
Author

hotwa commented Feb 3, 2022

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
Copy link

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
`

@rwxayheee
Copy link
Collaborator

As of today, the edited makefile in #340 includes BASE that is adapted to brew --prefix. Closing as resolved, but please feel free to re-open if there're any further issue.s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants