reaktoro / optima

A C++/Python library for numerical optimization calculations
GNU Lesser General Public License v2.1
12 stars 8 forks source link

Identifiers not found in Eigen library #18

Open Arsennnic opened 2 years ago

Arsennnic commented 2 years ago

Hi Optima developers, I wonder which Eigen version you used on your machines? I am trying to compile Optima with latest Eigen 3.4 (Windows x64, MSVC v14.3), but I encountered more than 2000 errors:

Error C2039: 'all' is not a member of 'Eigen' (compiling source file C:\Users\xxxx\Desktop\optima-0.2.5\Optima\Convergence.cpp)
Error C2039: 'zeros' is not a member of 'Eigen' (compiling source file C:\Users\xxxx\Desktop\optima-0.2.5\Optima\Convergence.cpp)
Error C2039: 'ones' is not a member of 'Eigen' (compiling source file C:\Users\xxxx\Desktop\optima-0.2.5\Optima\Convergence.cpp)
...
Error C2873: 'rowsmap' symbol cannot be used in a using-declaration (compiling source file C:\Users\xxxx\Desktop\optima-0.2.5\Optima\Convergence.cpp)
...

It seems that most errors happen in Optima/deps/eigenx/Eigen/Typedefs. Would you help me solve the problem? Thank you.

allanleal commented 2 years ago

These are auxiliary functions defined in Optima/deps/eigenx/Eigen/Functions. Are you properly using CMake to configure and build the project?

Arsennnic commented 2 years ago

I have tried two ways to configure and build the project:

cmake -DBUILD_PATH=build -DPREFIX=installed -DPYTHON=OFF -P install

and

mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=installed -DOPTIMA_BUILD_PYTHON=OFF ..
cmake --build .
allanleal commented 2 years ago

You may have to enable build python.

On Wed, May 18, 2022, 3:54 PM Hawk Shaw @.***> wrote:

I have tried two ways to configure and build the project:

cmake -DBUILD_PATH=build -DPREFIX=installed -DPYTHON=OFF -P install

and

mkdir build && cd build cmake -DCMAKE_INSTALL_PREFIX=installed -DOPTIMA_BUILD_PYTHON=OFF .. cmake --build .

— Reply to this email directly, view it on GitHub https://github.com/reaktoro/optima/issues/18#issuecomment-1130047699, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABMOINHWXAZHBJRGYA77NI3VKTZB3ANCNFSM5WFFNZ3A . You are receiving this because you commented.Message ID: @.***>

Arsennnic commented 2 years ago

I enable Python with pybind11_DIR but it did not work:

cmake -DBUILD_PATH=build -DPREFIX=installed -DPYTHON=ON -P install

Even more errors were raised.

allanleal commented 2 years ago

I don't know what is going on there. Here it works fine (are you using conda and created a conda environment called optima containing the dependencies? See screenshot below:

image

Also, Eigen version has to be 3.3.90 -- not 3.4. In this Eigen transition, some strange runtime errors are happening. Optima relies heavily on indexed views from Eigen; and this seems to be a bit unstable in 3.4.