Hi Akthem,

I cannot answer all your questions, since I know nearly nothing about the 
subject of your work, but I can try to find other collegues familiar with 
chrono and fluid simulation.

I can help you to get over the macOS issues yet.

1) Xcode, I sometimes have the same error you got. That helped on my 
machine, type on the command line :
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

2) Using OpenMP on the Mac:
- install libomp with homebrew (that will bring omp.h for and other good 
things)
- install thrust, well it is header-only, you must tell cmake the correct 
include path
- install blaze, also header only, same procedure like thrust

Now comes the cumbersome part, give all information to cmake

cmake  -G Ninja -S $REPOSITORY -B build \
-DCMAKE_BUILD_TYPE=Release \
-DOpenMP_CXX_FLAGS:STRING="-Xclang -fopenmp" \
-DOpenMP_C_FLAGS:STRING="-Xclang -fopenmp" \
-DOpenMP_C_INCLUDE_DIR:PATH=-L/opt/homebrew/opt/libomp/lib \
-DOpenMP_CXX_INCLUDE_DIR:PATH=/opt/homebrew/opt/libomp/include \
-DOpenMP_C_LIB_NAMES:STRING=libomp \
-DOpenMP_CXX_LIB_NAMES:STRING=libomp \
-DOpenMP_libomp_LIBRARY:FILEPATH="/opt/homebrew/opt/libomp/lib/libomp.dylib" 
\
-DTHRUST_INCLUDE_DIR:PATH=${DEPFIX}/include \
-DBLAZE_INSTALL_DIR:PATH=${DEPFIX}/include \
               ... your desired settings ...

Best Regards

Rainer
[email protected] schrieb am Donnerstag, 27. April 2023 um 01:02:45 UTC+2:

> Hi Rainer,
> Thank you! Following the instructions to the letter successfully builds 
> and installs Chrono as per the two scenarios you provided above. On a side 
> note, Ninja and the default Unix Makefiles worked while Xcode returned 
> errors asking for default compilers. Perhaps this is an error related to my 
> mac setup!
>
> Having another go on the documentation, it clearly states that the FSI and 
> Sensor modules are not supported in MacOS. However, I think Multicore 
> could be built on MacOS if Thrust could be built on top of openMP. Could 
> you please confirm if this is correct/doable? If correct, could you share 
> updated syntax and dependencies for the cmake and build? From my end I had 
> a failed attempt trying to cmake Thrust with the following command: cmake 
> -DTHRUST_DEVICE_BACKEND=OMP /path/to/thrust/source
>
> Based on  a pump health monitoring simulation use-case I am working on, 
> and given that FSI and Sensor are not within my disposal, I came up with 
> this workflow utilizing open-source Mac friendly tools: 
>
>    1. Create the pump geometry using FreeCAD.
>    2. Mesh the pump geometry using GMSH (or perhaps CFMesh) and export it 
>    to OpenFOAM format.
>    3. Set up the simulation using OpenFOAM and the Elmer-OpenFOAM 
>    library. Use OpenFOAM to solve for the fluid flow and ElmerFEM to solve 
> for 
>    the structural mechanics. Use the Elmer-OpenFOAM library to couple the two 
>    solvers.
>    4. In the simulation, introduce random faults (such as misalignment, 
>    unbalance, bearing fault, or others) and simulate the vibration 
>    acceleration.
>    5. Use Chrono to simulate the fault propagation and pump failure. 
>    Although Chrono's Sensor and FSI modules are not available, Chrono is 
> still 
>    used for rigid body dynamics capabilities to simulate the mechanical 
>    behavior of the pump.
>    6. Export the vibration (acceleration) data from Chrono to Paraview 
>    for visualization and analysis.
>    7. Use the FEM workbench in FreeCAD to analyze the vibration data and 
>    estimate the remaining useful life of the pump and/or faulty component.
>    
>
>    
> As I am researching and picking my toolset before getting to work, your 
> input on the workflow will be highly valued and appreciated. If any of the 
> above can still be done with Chrono to minimize the number of tools, 
> handovers, and of course the learning curve and time, please let me know. 
> Any other feedback is welcome too!
>
> Thank you!
>
> Sincerely,
> Akthem
> On Wednesday, April 26, 2023 at 8:35:28 AM UTC+2 [email protected] 
> wrote:
>
>> Hi Akthem,
>>
>> beginning the work with a complex project is always a challenge and one 
>> problem is: macOS does not support all chrono modules!
>>
>> It helps to begin with a minimal configuration:
>>
>> rm -rf build
>> cmake -S /where/your/chrono/source/is -B build
>>
>> my chrono sources are in ${HOME}/Documents/GitHub/chrono but this is not 
>> a law of nature, just take the path of your installation.
>> 'build' is the directory, where the configuration and the build take 
>> place. The build directory must be empty! The configuration should work.
>>
>> cmake --build build 
>>
>> or
>>
>> cd build
>> make 
>>
>> This should run without errors. What you get is a basic configuration 
>> with a couple of demos in build/bin
>>
>> Try the demos. Unfortunately we have to generate Mac Bundles, so to start 
>> an example you must write
>>
>> cd bin
>> ./demo_CH_EulerAngles.app/Content/MacOS/demo_CH_EulerAngles
>>
>> or 
>>
>> run_app.sh demo_CH_EulerAngles.app
>>
>> if you have installed the convenience script from 
>> *chronoSRC/contrib/appbundle-macosx*
>>
>> I am a vehicle simulation guy and I want to have the vehicle module 
>> enabled. Also necessary is postprocessing and 3d graphics:
>>
>> rm -rf build
>> cmake -S /where/your/chrono/source/is -B build \
>> -DCMAKE_BUILD_TYPE=Release \
>> -DENABLE_MODULE_POSTPROCESS:BOOL=ON \
>> -DENABLE_MODULE_VEHICLE:BOOL=ON \
>> -DENABLE_MODULE_IRRLICHT:BOOL=ON \
>> -DIRRLICHT_INSTALL_DIR:PATH=/opt/homebrew
>>
>> cmake generates Unix Makefiles by default, a faster alternative is ninja 
>> (cmake -G Ninja ....) or even better with and IDE (cmake -G Xcode ...). 
>> ninja can be installed with homebrew. You also need gnuplot, can also be 
>> installed with homebrew.
>>
>> Some modules in chrono can only work with Nvidia hardware and require 
>> cuda. Cuda is not available for macOS as well as OptiX.
>> Alternative for Irrlicht is VSG. It also works well, but some 
>> functionality is lacking actually. The configuration for OpenGL is messed 
>> up for macOS, so don't try it, or better try it and repair it. Generally 
>> spoken: activate only the modules that you ar willing to use!
>>
>> Good Start!
>>
>> Rainer 
>> [email protected] schrieb am Mittwoch, 26. April 2023 um 00:56:59 UTC+2:
>>
>>> Hi Project Chrono Team,
>>> I spent the day trying to Cmake project chrono. I followed the Mac OS 
>>> instructions in Chrono tutorial install 
>>> <https://api.projectchrono.org/tutorial_install_chrono.html>. I used 
>>> the preset "macOS CI Configuration" and generator "Unix Makefiles" in the 
>>> cmake GUI.
>>>
>>> This succeeds in building and generating project chrono after making 
>>> sure the value for "THRUST_INCLUDE_DIR" is empty. However it was built and 
>>> generated with Sensor, Distributed, GPU, FSI, and Multicore disabled. 
>>> Multicore requires Thrust while the other modules require Cuda. Both were 
>>> not found. 
>>>
>>> I failed to install Thrust without Cuda in a Mac Silicon. *Question 1: 
>>> Am I missing something or did I follow the steps correctly and none of 
>>> these modules can be run on a Mac Silicon?*
>>>
>>> Moving forward, I attempted to make from the generated build using:
>>>
>>>
>>> make CXXFLAGS="-Xpreprocessor -fopenmp" LDFLAGS="-lomp"
>>>
>>>
>>> This was based on the MacOS clang++ issues highlighted in step 8. This 
>>> results in 8 warnings and 1 error. The error being:
>>>
>>>
>>> */opt/homebrew/include/eigen3/Eigen/Core:70:10: **fatal error: **'omp.h' 
>>> file not found*
>>>
>>> #include <omp.h>
>>>
>>> *         ^~~~~~~*
>>>
>>> 8 warnings and 1 error generated.
>>>
>>> make[2]: *** 
>>> [src/chrono/CMakeFiles/ChronoEngine.dir/core/ChFilePS.cpp.o] Error 1
>>>
>>> make[1]: *** [src/chrono/CMakeFiles/ChronoEngine.dir/all] Error 2
>>>
>>> make: *** [all] Error 2
>>>
>>>
>>> *Question 2: Again, where did I go wrong here?*
>>>
>>>
>>> I am new to the macOS, shell, and cmake and the learning curve was steep 
>>> getting to this point. So, I hope you cut me some slack if any/all of my 
>>> questions are basic/naive and I hope you can help me get over this hurdle 
>>> and successfully run Chrono. Of course running the additional modules and 
>>> parallelization would be an amazing bonus after successful installation.
>>>
>>>
>>> From what I read, Chrono sounds solid in multi-body dynamics. I hope I 
>>> can make it run on my mac and start benefiting from it.
>>>
>>>
>>> Thank you,
>>>
>>> Akthem
>>>
>>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/projectchrono/9e88d913-6898-4c2b-af79-9825f65e2450n%40googlegroups.com.

Reply via email to