Closed luishpmendes closed 2 years ago
@luishpmendes it's probably a mistake on our part on declaring the minimum Boost version, as we normally test the code with the latest Boost version.
I would suggest you to set up a development environment via conda + conda-forge. You don't need root access for that.
See the instructions here:
https://docs.conda.io/en/latest/miniconda.html https://conda-forge.org/
Feel free to ask here if you need further directions.
@bluescarni thanks for the reply.
I installed the miniconda and used it to install pagmo, using the following commands
conda config --add channels conda-forge
conda config --set channel_priority strict
conda install pagmo pagmo-devel
However, when I try to compile the getting_started.cpp
file, I get the following error:
g++ -O2 -DNDEBUG -std=c++17 getting_started.cpp -pthread -lpagmo -lboost_serialization -ltbb
getting_started.cpp:3:10: fatal error: pagmo/algorithm.hpp: No such file or directory
#include <pagmo/algorithm.hpp>
^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
On my own machine, where I have root access, I installed pagmo from the source-code. And I compile the code adding the path to the pagmo installation directory, as follows:
g++ -O2 -DNDEBUG -std=c++17 getting_started.cpp -pthread -lpagmo -lboost_serialization -ltbb -I /path/to/pagmo/.local/include -L /path/to/pagmo/lib -Wl,-R/path/to/pagmo/lib
Do I still need to do something like that? If so, how do I find the directory where conda installed pagmo?
Update:
I found the directory where conda installed the packages. But I still can't compile.
g++ -O2 -DNDEBUG -std=c++17 getting_started.cpp -pthread -lpagmo -lboost_serialization -ltbb -I /home/luishpmendes/miniconda3/pkgs/boost-cpp-1.74.0-h359cf19_5/include -L /home/luishpmendes/miniconda3/pkgs/boost-cpp-1.74.0-h359cf19_5/lib -lboost_serialization -I /home/luishpmendes/miniconda3/pkgs/pagmo-devel-2.18.0-hd2e5b28_0/include -L /home/luishpmendes/miniconda3/pkgs/pagmo-2.18.0-h2eca7fd_0/lib -Wl,-R/home/luishpmendes/miniconda3/pkgs/pagmo-2.18.0-h2eca7fd_0/lib -I /home/luishpmendes/miniconda3/pkgs/tbb-devel-2021.4.0-h4bd325d_1/include -L /home/luishpmendes/miniconda3/pkgs/tbb-2021.4.0-h4bd325d_1/lib -Wl,-R/home/luishpmendes/miniconda3/pkgs/tbb-2021.4.0-h4bd325d_1/lib -I /home/luishpmendes/miniconda3/pkgs/nlopt-2.7.0-py39h3e08f04_2/include -L /home/luishpmendes/miniconda3/pkgs/nlopt-2.7.0-py39h3e08f04_2/lib -Wl,-R/home/luishpmendes/miniconda3/pkgs/nlopt-2.7.0-py39h3e08f04_2/lib -I /home/luishpmendes/miniconda3/pkgs/ipopt-3.14.4-h7ede334_0/include -L /home/luishpmendes/miniconda3/pkgs/ipopt-3.14.4-h7ede334_0/lib -Wl,-R/home/luishpmendes/miniconda3/pkgs/ipopt-3.14.4-h7ede334_0/lib -lpagmo -ltbb -pthread
In file included from /home/luishpmendes/miniconda3/pkgs/boost-cpp-1.74.0-h359cf19_5/include/boost/graph/adjacency_iterator.hpp:13:0,
from /home/luishpmendes/miniconda3/pkgs/boost-cpp-1.74.0-h359cf19_5/include/boost/graph/detail/adjacency_list.hpp:37,
from /home/luishpmendes/miniconda3/pkgs/boost-cpp-1.74.0-h359cf19_5/include/boost/graph/adjacency_list.hpp:255,
from /home/luishpmendes/miniconda3/pkgs/pagmo-devel-2.18.0-hd2e5b28_0/include/pagmo/topology.hpp:43,
from /home/luishpmendes/miniconda3/pkgs/pagmo-devel-2.18.0-hd2e5b28_0/include/pagmo/archipelago.hpp:56,
from getting_started.cpp:5:
/home/luishpmendes/miniconda3/pkgs/boost-cpp-1.74.0-h359cf19_5/include/boost/detail/iterator.hpp:13:37: note: #pragma message: This header is deprecated. Use <iterator> instead.
BOOST_HEADER_DEPRECATED("<iterator>")
^
In file included from getting_started.cpp:5:0:
/home/luishpmendes/miniconda3/pkgs/pagmo-devel-2.18.0-hd2e5b28_0/include/pagmo/archipelago.hpp:143:35: warning: type attributes ignored after type is already defined [-Wattributes]
friend class PAGMO_DLL_PUBLIC island;
^~~~~~
/usr/bin/ld: warning: libdmumps_seq-5.2.1.so, needed by //home/luishpmendes/miniconda3/pkgs/ipopt-3.14.4-h7ede334_0/lib/libipopt.so.3, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libmumps_common_seq-5.2.1.so, needed by //home/luishpmendes/miniconda3/pkgs/ipopt-3.14.4-h7ede334_0/lib/libipopt.so.3, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libpord_seq-5.2.1.so, needed by //home/luishpmendes/miniconda3/pkgs/ipopt-3.14.4-h7ede334_0/lib/libipopt.so.3, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libmpiseq_seq-5.2.1.so, needed by //home/luishpmendes/miniconda3/pkgs/ipopt-3.14.4-h7ede334_0/lib/libipopt.so.3, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libesmumps-6.so, needed by //home/luishpmendes/miniconda3/pkgs/ipopt-3.14.4-h7ede334_0/lib/libipopt.so.3, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libscotch-6.so, needed by //home/luishpmendes/miniconda3/pkgs/ipopt-3.14.4-h7ede334_0/lib/libipopt.so.3, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libscotcherr-6.so, needed by //home/luishpmendes/miniconda3/pkgs/ipopt-3.14.4-h7ede334_0/lib/libipopt.so.3, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libmetis.so, needed by //home/luishpmendes/miniconda3/pkgs/ipopt-3.14.4-h7ede334_0/lib/libipopt.so.3, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libgfortran.so.5, needed by //home/luishpmendes/miniconda3/pkgs/ipopt-3.14.4-h7ede334_0/lib/libipopt.so.3, not found (try using -rpath or -rpath-link)
/home/luishpmendes/miniconda3/pkgs/pagmo-2.18.0-h2eca7fd_0/lib/libpagmo.so: undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()@GLIBCXX_3.4.26'
//home/luishpmendes/miniconda3/pkgs/ipopt-3.14.4-h7ede334_0/lib/libipopt.so.3: undefined reference to `dmumps_c'
/home/luishpmendes/miniconda3/pkgs/pagmo-2.18.0-h2eca7fd_0/lib/libpagmo.so: undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream()@GLIBCXX_3.4.26'
collect2: error: ld returned 1 exit status
As conda apparently installed the correct boost version, I tried installing pagmo from source, and it worked.
However, when I try to compile the getting_started.cpp
file, it gives the following warning:
g++ -O0 -DNDEBUG -std=c++17 getting_started.cpp -o getting_started -pthread -lpagmo -lboost_serialization -ltbb -I /home/luishpmendes/pagmo/include -L /home/luishpmendes/pagmo/lib -Wl,-R/home/luishpmendes/pagmo/lib -I /home/luishpmendes/miniconda3/pkgs/tbb-devel-2021.4.0-h4bd325d_1/include -L /home/luishpmendes/miniconda3/pkgs/tbb-2021.4.0-h4bd325d_1/lib -Wl,-R/home/luishpmendes/miniconda3/pkgs/tbb-2021.4.0-h4bd325d_1/lib -I /home/luishpmendes/miniconda3/pkgs/boost-cpp-1.74.0-h359cf19_5/include -L /home/luishpmendes/miniconda3/pkgs/boost-cpp-1.74.0-h359cf19_5/lib
In file included from /home/luishpmendes/miniconda3/pkgs/boost-cpp-1.74.0-h359cf19_5/include/boost/graph/adjacency_iterator.hpp:13:0,
from /home/luishpmendes/miniconda3/pkgs/boost-cpp-1.74.0-h359cf19_5/include/boost/graph/detail/adjacency_list.hpp:37,
from /home/luishpmendes/miniconda3/pkgs/boost-cpp-1.74.0-h359cf19_5/include/boost/graph/adjacency_list.hpp:255,
from /home/luishpmendes/pagmo/include/pagmo/topology.hpp:43,
from /home/luishpmendes/pagmo/include/pagmo/archipelago.hpp:56,
from getting_started.cpp:5:
/home/luishpmendes/miniconda3/pkgs/boost-cpp-1.74.0-h359cf19_5/include/boost/detail/iterator.hpp:13:37: note: #pragma message: This header is deprecated. Use <iterator> instead.
BOOST_HEADER_DEPRECATED("<iterator>")
^
In file included from getting_started.cpp:5:0:
/home/luishpmendes/pagmo/include/pagmo/archipelago.hpp:143:35: warning: type attributes ignored after type is already defined [-Wattributes]
friend class PAGMO_DLL_PUBLIC island;
^~~~~~
And, it failt when I try to execute it:
./getting_started
./getting_started: error while loading shared libraries: libtbb.so.12: cannot open shared object file: No such file or directory
Finally manage to make it work. I needed to set some environment variables. Thanks for the help and sorry for flooding this thread.
@luishpmendes glad to hear you solved it.
In the future, I would recommend to:
conda install cxx-compiler c-compiler
),
I am having a hard time trying to install pagmo2 from source. The machine runs Ubuntu 18.04.5 LTS and have Boost version 1.65.1. Even though the Boost satisfies the minimum version requirement, I tried to install a newer version locally (I do not have super user access), but cmake doesn't find. When I try to install, I get the following error. Can anyone help me, please?