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

Problem building Sundials 6.2.0 with cmake 3.21 on macOS #157

Closed
mottelet opened this issue Jun 13, 2022 · 2 comments
Closed

Problem building Sundials 6.2.0 with cmake 3.21 on macOS #157

mottelet opened this issue Jun 13, 2022 · 2 comments

Comments

@mottelet
Copy link
Contributor

Hello,

I cannot build Sundials 6.2.0 using cmake 3.21 on macOS : I get the following output

portmottelet-cr-1:build mottelet$ /Users/mottelet/git/CMake/bin/cmake cmake ../src -DCMAKE_INSTALL_PREFIX=/Users/mottelet/git/sundials6.2.0/inst/ -DEXAMPLES_INSTALL_PATH=/Users/mottelet/git/sundials6.2.0/examples

CMake Warning (dev) in CMakeLists.txt:
  No project() command is present.  The top-level CMakeLists.txt file must
  contain a literal, direct call to the project() command.  Add a line of
  code such as

    project(ProjectName)

  near the top of the file, but after cmake_minimum_required().

  CMake is pretending there is a "project(Project)" command on the first
  line.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- The C compiler identification is AppleClang 10.0.1.10010046
-- The CXX compiler identification is AppleClang 10.0.1.10010046
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at sundials/CMakeLists.txt:69 (add_prefix):
  Unknown CMake command "add_prefix".


CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 3.21)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

How can I fix it ?

Thanks for help

@drreynolds
Copy link
Collaborator

It's a bit unclear from your post, but can you clarify the build directory structure for your call? From the first line it looks like you have something like:

git clone git@github.com:LLNL/sundials.git
cd sundials
mkdir build
cd build
/Users/mottelet/git/CMake/bin/cmake cmake ../src -DCMAKE_INSTALL_PREFIX=/Users/mottelet/git/sundials6.2.0/inst/ -DEXAMPLES_INSTALL_PATH=/Users/mottelet/git/sundials6.2.0/examples

If that is the case, then I recommend that you change your cmake command to instead be

/Users/mottelet/git/CMake/bin/cmake cmake .. -DCMAKE_INSTALL_PREFIX=/Users/mottelet/git/sundials6.2.0/inst/ -DEXAMPLES_INSTALL_PATH=/Users/mottelet/git/sundials6.2.0/examples

to ensure that CMake is directed to the top-level SUNDIALS folder, and not the src subfolder.

If that was not your setup, then could you provide a bit more information about how this is laid out for you?

@mottelet
Copy link
Contributor Author

mottelet commented Jun 13, 2022

Sorry, I thought that the src folder what the target (now it works).

Thanks a lot. I have another instance of 6.2.0 within Scilab but I need to build standalone examples to make some comparisons (see my other question).

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

2 participants