OpenCRG build target x64 & Vehicle Module

58 views
Skip to first unread message

J D

unread,
Oct 30, 2023, 8:24:01 PM10/30/23
to ProjectChrono
Hello again,

This might be a small thing, but it contributed to a lot of problem solving why my Vehicle module wouldn't compile. So it might help another newbie.

I didn't find anything about this in the installation documentation, and it may not be immediately obvious, but the default target for VS developer console might not always align with the target chosen for building Chrono.

For example, I'm running an x64 build, and it took a long time digging through various LINK errors to realise that before I used the build scripts, I needed to run "vcvarsall.bat x64" in the developer console (usually in C:\Program Files\Microsoft Visual Studio\<version>\<edition>\VC\Auxiliary\Build)

After re-building the scripts with the right target set in console, the ChronoEngine_vehicle.dll and dependent compiles were successful.

If this is helpful for others, it might be worth adding to the documentation here: https://api.projectchrono.org/module_vehicle_installation.html

Kind regards,

Josh

Radu Serban

unread,
Oct 31, 2023, 7:02:08 AM10/31/23
to ProjectChrono

Josh,

 

Just to confirm, this is happening for you when running the buildOpenCRG.bat script from under contrib/build-scripts/opencrg/, correct?

I cannot reproduce this issue and have not heard anyone else having this problem.  I don’t even need to run this script from a VS developer console. Have you tried running this from a cmd or powershell console? Do you get the same issues?  This may be due to a particular installation of your VS. By the way, what version of VS do you use?

 

I don’t see a problem adding a notice about this possible issue in the installation guide, but I’d like first to know it’s not just some peculiarity of your setup.

 

Thanks,
Radu

--
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/df47c5f0-c95c-4865-8a72-edc9577a8f33n%40googlegroups.com.

J D

unread,
Nov 3, 2023, 4:01:01 PM11/3/23
to ProjectChrono
Hi Radu,

Thanks for the response. Yes, correct, I'm using the buildopencrg.bat script from that directory.
I haven't attempted to run from cmd or powershell. I had only run it from the VS developer console, since that was the direction in the .bat script.

The VS I'm using is 2022 (64-bit), version 17.7.6

When I've a spare moment, I'll attempt a run from cmd/powershell and see if that alters the build. Will report back.

Kind regards,

Josh

Radu Serban

unread,
Nov 3, 2023, 4:41:39 PM11/3/23
to ProjectChrono

JD,

 

Sorry for the confusion.  Ignore my previous message about running this from a cmd or powershell console.

I was thinking of some of the other scripts for installing various dependencies.  OpenCRG is a bit special in that it is not distributed with any sort of configuration script (such as CMake) and so, I had to directly invoke the cl compiler. 

 

As the instructions in the script indicate, you have to run this from a VS developer console.  Since we build everything 64-bit, make sure you start the “x64 Native Tools Command Prompt for …” console.  That will invoke vcvarsall.bat to initialize the environment for ‘x64’.

 

I suspect you somehow end up running the “x86 Native …” which initializes the ‘x86’ environment.

 

--Radu

J D

unread,
Nov 3, 2023, 9:06:57 PM11/3/23
to ProjectChrono
That makes more sense. I was just trying cmd then and couldn't call "cl" without specifying the full path to the x64 version.
Good to know!!

You are exactly correct, i just double checked and I had indeed been opening the x86 version of the developer command prompt. Careless!

Thanks for your help,

Kind regards,

Josh
Reply all
Reply to author
Forward
0 new messages