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

Unable to compile on M1 mac due to libboost dependency #131

Open
JudeWells opened this issue Oct 9, 2022 · 4 comments
Open

Unable to compile on M1 mac due to libboost dependency #131

JudeWells opened this issue Oct 9, 2022 · 4 comments

Comments

@JudeWells
Copy link

When attempting to run .configure I get the following error:

checking for boostlib >= 1.54... configure: We could not detect the boost libraries (version 1.54 or higher). If you have a staged boost library (still not installed) please specify $BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation.
configure: error: libboost_base not found

I tried using homebrew to install boost: brew install boost but still get the same error

So I tried exporting the path to where boost was installed:
BOOST_ROOT=/opt/homebrew/Cellar/boost/1.80.0

Still getting the same error.

I ran the following:
./configure --with-boost=no

^ This successfully executes but upon attempting to run make I get the following error:

/Library/Developer/CommandLineTools/usr/bin/make all-am
depbase=echo src/blast.o | sed 's|[^/]*$|.deps/&|;s|\.o$||';
g++ -DHAVE_CONFIG_H -I. -std=c++11 -pedantic -Wall -Werror -Wno-reorder -I./src/ -g -O2 -MT src/blast.o -MD -MP -MF $depbase.Tpo -c -o src/blast.o src/blast.cpp &&
mv -f $depbase.Tpo $depbase.Po
In file included from src/blast.cpp:7:
In file included from ./src/blast.h:15:
./src/mas.h:31:10: fatal error: 'boost/version.hpp' file not found
#include <boost/version.hpp>
^~~~~~~~~~~~~~~~~~~
1 error generated.
make[1]: *** [src/blast.o] Error 1
make: *** [all] Error 2

System is M1 MacBook Pro with MacOS Monterey 12.5.1

Any help/advice much appreciated.

@Moomboh
Copy link

Moomboh commented Nov 3, 2023

Got it to compile on Apple M1 Max macOS 13.5.2.

First make sure you have all the other necessary dependencies installed:

brew install zlib bzip2 autoconf automake

Then install boost at version 1.76 with homebrew (1.83 did not work for me):

brew install [email protected]

Once installed export compiler flags for it to be able to find boost:

export LDFLAGS="-L/opt/homebrew/opt/[email protected]/lib"
export CPPFLAGS="-I/opt/homebrew/opt/[email protected]/include"

Also add compiler flags to ignore deprecated and unused variable warnings (needs to be set before ./configure, otherwise make will fail later):

export CPPFLAGS="$CPPFLAGS -Wno-deprecated -Wno-unused-but-set-variable"

Finally just follow the instructions but additionally pass the boost libdir to ./configure:

./autogen.sh
./configure --with-boost-libdir=/opt/homebrew/opt/[email protected]/lib 
make

Hope this might help some people!

@tnozturk
Copy link

Following everything suggested above, I'm getting the following errors:

In file included from src/dssp.cpp:11:
./src/mas.h:44:9: error: keyword is hidden by macro definition [-Werror,-Wkeyword-macro]
#define nullptr NULL
        ^
In file included from src/dssp.cpp:14:
In file included from ./src/structure.h:11:
In file included from ./src/primitives-3d.h:16:
In file included from /opt/homebrew/Cellar/boost/1.84.0//include/boost/math/quaternion.hpp:14:
/opt/homebrew/Cellar/boost/1.84.0//include/boost/math/tools/config.hpp:23:6: error: #warning is a C++2b extension [-Werror,-Wpedantic]
#    warning "The minimum language standard to use Boost.Math will be C++14 starting in July 2023 (Boost 1.82 release)"
     ^
/opt/homebrew/Cellar/boost/1.84.0//include/boost/math/tools/config.hpp:23:6: error: "The minimum language standard to use Boost.Math will be C++14 starting in July 2023 (Boost 1.82 release)" [-Werror,-W#warnings]
In file included from src/dssp.cpp:16:
/opt/homebrew/Cellar/boost/1.84.0//include/boost/bind.hpp:36:1: warning: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated. Please use <boost/bind/bind.hpp> + using namespace boost::placeholders, or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior. [-W#pragma-messages]
BOOST_PRAGMA_MESSAGE(
^
/opt/homebrew/Cellar/boost/1.84.0//include/boost/config/pragma_message.hpp:24:34: note: expanded from macro 'BOOST_PRAGMA_MESSAGE'
# define BOOST_PRAGMA_MESSAGE(x) _Pragma(BOOST_STRINGIZE(message(x)))
                                 ^

@beavenah
Copy link

I was able to compile using @Moomboh 's suggestions. Just to note that I needed to add the extra option:

export CPPFLAGS="$CPPFLAGS -Wno-deprecated -Wno-unused-but-set-variable -Wno-enum-constexpr-conversion"

@bj600800
Copy link

Got it to compile on Apple M1 Max macOS 13.5.2.

First make sure you have all the other necessary dependencies installed:

brew install zlib bzip2 autoconf automake

Then install boost at version 1.76 with homebrew (1.83 did not work for me):

brew install [email protected]

Once installed export compiler flags for it to be able to find boost:

export LDFLAGS="-L/opt/homebrew/opt/[email protected]/lib"
export CPPFLAGS="-I/opt/homebrew/opt/[email protected]/include"

Also add compiler flags to ignore deprecated and unused variable warnings (needs to be set before ./configure, otherwise make will fail later):

export CPPFLAGS="$CPPFLAGS -Wno-deprecated -Wno-unused-but-set-variable"

Finally just follow the instructions but additionally pass the boost libdir to ./configure:

./autogen.sh
./configure --with-boost-libdir=/opt/homebrew/opt/[email protected]/lib 
make

Hope this might help some people!

@Moomboh I love you soooooo much!
Thanks to your instructions, totally saving my life. Thank you!

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

5 participants