CMake version problem for chrono tutorials

257 views
Skip to first unread message

Prakhar Gupta

unread,
Oct 10, 2023, 4:51:27 PM10/10/23
to ProjectChrono
Hi,
I have installed and built chrono-8.0.0 on Ubuntu 18.04. I can run all the demos OK.

I am trying to create a new project, using tutorials ( https://github.com/projectchrono/chrono-tutorial/tree/8.0.0 ), and the template_project folder that comes with chrono (https://api.projectchrono.org/tutorial_install_project.html). When I try to configure the cmake, for these projects, I get errors for "PREPEND" subcommand not recognized. I am aware that these commands were added to cmake in only the later versions, and not in 3.10. I wonder if I am doing something wrong, or am supposed to run another template project/ tutorial versions?

Config:
gcc 7.5.0
cmake 3.10.2
irrlicht 1.8.4

CMAKE configuration Output for the tutorials case (I get same PREPEND unrecognized error for the template_project  too that came with the /chrono directory)

-------------------------------------------------------------------------

==== Chrono programs ====

Finding package Chrono...

CMake Error at /home/cralab/chrono/chrono_build/cmake/ChronoConfig.cmake:83 (list):
list does not recognize sub-command PREPEND
Call Stack (most recent call first):
slider_crank/CMakeLists.txt:16 (find_package)

CMake Error at /home/cralab/chrono/chrono_build/cmake/ChronoConfig.cmake:86 (list):
list does not recognize sub-command PREPEND
Call Stack (most recent call first):
slider_crank/CMakeLists.txt:16 (find_package)

Requested component Irrlicht (REQUIRED)

CMake Error at /home/cralab/chrono/chrono_build/cmake/ChronoConfig.cmake:258 (list):
list does not recognize sub-command PREPEND
Call Stack (most recent call first):
slider_crank/CMakeLists.txt:16 (find_package)

CMake Error at /home/cralab/chrono/chrono_build/cmake/ChronoConfig.cmake:264 (list):
list does not recognize sub-command PREPEND
Call Stack (most recent call first):
slider_crank/CMakeLists.txt:16 (find_package)

CHRONO_CXX_FLAGS (Compiler flags): ;-pthread;-fopenmp;-march=native

CHRONO_C_FLAGS (Compiler flags): ;-pthread;-fopenmp;-march=native

CHRONO_LINKER_FLAGS (Linker flags): -L/home/cralab/chrono/chrono_build/lib

CHRONO_INCLUDE_DIRS (Chrono include directories): /home/cralab/chrono/chrono/src;/home/cralab/chrono/chrono/src/chrono;/home/cralab/chrono/chrono/src/chrono/collision/bullet;/home/cralab/chrono/chrono/src/chrono/collision/gimpact;/home/cralab/chrono/chrono/src/chrono_thirdparty/HACD;/home/cralab/chrono/chrono/src/chrono_thirdparty/HACDv2;/home/cralab/chrono/chrono_build;/usr/local/include/eigen3;;/usr/include/irrlicht

CHRONO_LIB_NAMES (Chrono library names):

CHRONO_LIBRARIES (Chrono libraries): /usr/lib/gcc/x86_64-linux-gnu/7/libgomp.so;/usr/lib/x86_64-linux-gnu/libpthread.so;;/usr/lib/x86_64-linux-gnu/libIrrlicht.so;-lXxf86vm;-lglut;-lX11;-lGL

CHRONO_DLL_NAMES (Chrono DLL names):

CHRONO_DLLS (Chrono DLLs):

CHRONO_DATA_DIR (Path to Chrono data folder): /home/cralab/chrono/chrono/data/

CHRONO_VEHICLE_DATA_DIR (Path to Chrono::Vehicle data folder): /home/cralab/chrono/chrono/data/vehicle/

CHRONO_FSI_DATA_DIR (Path to Chrono::FSI data folder): /home/cralab/chrono/chrono/data/fsi/

...add slider_crank_0

CMake Error at slider_crank/CMakeLists.txt:55 (target_link_options):
Unknown CMake command "target_link_options".

Configuring incomplete, errors occurred!

See also "/home/cralab/chrono/chrono-tutorial-8.0.0_build/CMakeFiles/CMakeOutput.log".


---------------------------------------------------------------------


Any help is appreciated!
Thanks!
Prakhar Gupta

Dario Mangoni

unread,
Oct 10, 2023, 4:59:36 PM10/10/23
to Prakhar Gupta, ProjectChrono
Hi Prakhar,
we just changed the template project and the relative chrono-config file so we surely need some feedback. 

Could you update CMake to latest version? 

Dario

-------- Messaggio originale --------
Da: Prakhar Gupta <imprakh...@gmail.com>
Data: 10/10/23 22:51 (GMT+01:00)
A: ProjectChrono <projec...@googlegroups.com>
Oggetto: [chrono] CMake version problem for chrono tutorials

--
You received this message because you are subscribed to the Google Groups "ProjectChrono" group.
To unsubscribe from this group and stop receiving emails from it, send an email to projectchron...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/projectchrono/78bcf2be-ad2f-4da8-9c60-c69f9cad3b36n%40googlegroups.com.

Prakhar Gupta

unread,
Oct 10, 2023, 5:33:11 PM10/10/23
to ProjectChrono
Yes, that fixed the error with cmake 3.27.7. I was just thrown off, because the cmake minimum version in the cmake files for all chrono was 3.10, and it does the job too. I did not expect tutorials to be requiring a different version.

Thanks for the help!
Cheers,
Prakhar

Radu Serban

unread,
Oct 11, 2023, 1:22:19 AM10/11/23
to ProjectChrono

Hi Prakhar,

 

Thanks for pointing this out. We missed it in the 8.0 release but will make sure to update the template project in the latest development code so that it requires a proper CMake version, compatible with Chrono itself.

 

On a different note, like Dario also suggested, I encourage you to start using the latest code in the ‘main’ branch of the Chrono git repository. There have been many enhancements, new features, and bug fixes since the 8.0 release.

 

--Radu

Prakhar Gupta

unread,
Oct 11, 2023, 5:50:43 AM10/11/23
to ProjectChrono
Radu,
Thanks for the suggestion - I will switch over to the main branch.

Prakhar

Message has been deleted

Prakhar Gupta

unread,
Oct 11, 2023, 1:28:17 PM10/11/23
to ProjectChrono
Radu,
I am building the main branch now - with the MATLAB module.

This leads to following error during make:

----------------------------------------------------------------

In file included from /home/cralab/chrono/chrono/src/chrono_matlab/ChMatlabEngine.cpp:15:0:
/home/cralab/chrono/chrono/src/chrono_matlab/ChMatlabEngine.h:85:10: error: extra qualification ‘chrono::ChMatlabEngine::’ on member ‘GetString’ [-fpermissive]
     bool ChMatlabEngine::GetString(std::string& str, std::string varname);
          ^~~~~~~~~~~~~~
src/chrono_matlab/CMakeFiles/ChronoEngine_matlab.dir/build.make:75: recipe for target 'src/chrono_matlab/CMakeFiles/ChronoEngine_matlab.dir/ChMatlabEngine.cpp.o' failed

---------------------------------------------------------------

I removed the extra namespace qualification and it works. If you agree with this fix, I can create an issue on github and create a pull request.

Prakhar

Radu Serban

unread,
Oct 11, 2023, 1:29:25 PM10/11/23
to ProjectChrono

Hi Prakhar,

 

Thanks for the heads up. You are correct, this isa bug (most likely a copy and paste).

I’ll push the fix soon.

 

--Radu

 

From: projec...@googlegroups.com <projec...@googlegroups.com> On Behalf Of Prakhar Gupta
Sent: Wednesday, October 11, 2023 7:22 PM
To: ProjectChrono <projec...@googlegroups.com>
Subject: Re: [chrono] CMake version problem for chrono tutorials

 

Radu,

I am building the main branch now - with the MATLAB module.

 

This leads to following error during make:

 

----------------------------------------------------------------

 

In file included from /home/cralab/chrono/chrono/src/chrono_matlab/ChMatlabEngine.cpp:15:0:
/home/cralab/chrono/chrono/src/chrono_matlab/ChMatlabEngine.h:85:10: error: extra qualification ‘chrono::ChMatlabEngine::’ on member ‘GetString’ [-fpermissive]
     bool ChMatlabEngine::GetString(std::string& str, std::string varname);
          ^~~~~~~~~~~~~~
src/chrono_matlab/CMakeFiles/ChronoEngine_matlab.dir/build.make:75: recipe for target 'src/chrono_matlab/CMakeFiles/ChronoEngine_matlab.dir/ChMatlabEngine.cpp.o' failed

 

---------------------------------------------------------------

 

I removed the extra class declaration and it works. If you agree with this fix, I can create an issue on github and create a pull request.

 

Prakhar

Prakhar Gupta

unread,
Oct 11, 2023, 2:54:37 PM10/11/23
to ProjectChrono
Radu,
Going back to building projects that use chrono - Are the tutorials from the main branch (https://github.com/projectchrono/chrono-tutorial/tree/main) supposed to build in the current commit?
I cannot build the template projects or the tutorial projects for the main branch. This is after I can successfully run the demos.

I am attaching the log from the make process.
make_log.txt

Radu Serban

unread,
Oct 11, 2023, 3:14:31 PM10/11/23
to ProjectChrono
Hi Prakhar,

Yes, the chrono-tutorial project, as well as the template project in the Chrono repository are supposed to work (assuming you have pulled the latest code in both repos).

Having said that, Dario and I worked in this part of the code recently, with some significant changes and so it's possible we introduced a bug. I don't see any issues on my windows box.

Could you please send us your cmake cache file and the output from cmake when configuring chrono-tutorial?

--Radu


From: projec...@googlegroups.com <projec...@googlegroups.com> on behalf of Prakhar Gupta <imprakh...@gmail.com>
Sent: Wednesday, October 11, 2023 8:54:44 PM

Prakhar Gupta

unread,
Oct 11, 2023, 3:21:27 PM10/11/23
to ProjectChrono
Here you go:
 
Prakhar
CMakeCache.txt
cmake_configure_out.txt

Dario Mangoni

unread,
Oct 11, 2023, 4:40:16 PM10/11/23
to Prakhar Gupta, ProjectChrono
Thanks, I think I need to make a run on a Linux machine. I didn't have the chance yet

-------- Messaggio originale --------
Da: Prakhar Gupta <imprakh...@gmail.com>
Data: 11/10/23 21:21 (GMT+01:00)
A: ProjectChrono <projec...@googlegroups.com>
Oggetto: Re: [chrono] CMake version problem for chrono tutorials

Prakhar Gupta

unread,
Oct 11, 2023, 4:52:14 PM10/11/23
to Dario Mangoni, ProjectChrono
Thanks! I'll look foward to it. 

Radu Serban

unread,
Oct 12, 2023, 6:58:45 AM10/12/23
to ProjectChrono

Prakhar,

 

Dario and I worked out a fix for the issue you reported with the Chrono project configuration script.

I tested this with the chrono-tutorial projects, on both Windows and Linux. 

Please pull the latest code and let us know if this resolves your issue.  Note that I also pushed the fix to the ChMatlabEngine.h header.

Prakhar Gupta

unread,
Oct 12, 2023, 11:36:20 AM10/12/23
to ProjectChrono
Thanks Radu, Dario,
I am able to build the projects now.

Prakhar
Reply all
Reply to author
Forward
0 new messages