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

No such file or directory: './configure' #9

Open
AJamesPhillips opened this issue Jan 28, 2022 · 8 comments
Open

No such file or directory: './configure' #9

AJamesPhillips opened this issue Jan 28, 2022 · 8 comments
Assignees

Comments

@AJamesPhillips
Copy link

AJamesPhillips commented Jan 28, 2022

Thank you so much for this library. I'm running:

With the FMU from 1.18.0 uploaded to http://localhost:8080/compiler/ it gave me this error about No such file or directory: './configure':

=== Processing file /home/vagrant/Bodylight.js-FMU-Compiler/input/LorenzAttractor.fmu ===
Compiling OpenModelica FMU, log: /home/vagrant/Bodylight.js-FMU-Compiler/output/LorenzAttractor.log
script version 2
configure: ./configure "CFLAGS=-Wno-unused-value -Wno-logical-op-parentheses" "CPPFLAGS=-DOMC_MINIMAL_METADATA=1 -I/home/vagrant/Bodylight.js-FMU-Compiler/compiler/sources/fmi -I/usr/local/include"
emconfigure: error: './configure "CFLAGS=-Wno-unused-value -Wno-logical-op-parentheses" "CPPFLAGS=-DOMC_MINIMAL_METADATA=1 -I/home/vagrant/Bodylight.js-FMU-Compiler/compiler/sources/fmi -I/usr/local/include"' failed: [Errno 2] No such file or directory: './configure'
make: make -Wno-unused-value
clang -Os -Wno-parentheses-equality -falign-functions -mstackrealign -msse2 -mfpmath=sse  -I"C:/Program Files/OpenModelica1.18.0-64bit/include/omc/c/fmi" -DOMC_FMI_RUNTIME=1 -DCMINPACK_NO_DLL=1   -c -o LorenzAttractor.o LorenzAttractor.c
/bin/sh: clang: command not found
make: *** [LorenzAttractor.o] Error 127
emmake: error: 'make -Wno-unused-value' failed (2)
openmodelica.sh: line 41: ../output/flags: No such file or directory
emcc: error: /home/vagrant/Bodylight.js-FMU-Compiler/compiler/build/fmu/binaries/linux64/LorenzAttractor.so: No such file or directory ("/home/vagrant/Bodylight.js-FMU-Compiler/compiler/build/fmu/binaries/linux64/LorenzAttractor.so" was expected to be an input file, based on the commandline arguments provided)
rm: cannot remove ‘/home/vagrant/Bodylight.js-FMU-Compiler/compiler/build/fmu/LorenzAttractor.js’: No such file or directory
ERROR: compilation unsuccessful, check log for details.

I downgraded OMEdit to 1.14.1, rebuilt the FMU and tried http://localhost:8080/compiler again and it gave me a similar error:

=== Processing file /home/vagrant/Bodylight.js-FMU-Compiler/input/LorenzAttractor.fmu ===
Compiling OpenModelica FMU, log: /home/vagrant/Bodylight.js-FMU-Compiler/output/LorenzAttractor.log
script version 2
configure: ./configure "CFLAGS=-Wno-unused-value -Wno-logical-op-parentheses" "CPPFLAGS=-DOMC_MINIMAL_METADATA=1 -I/home/vagrant/Bodylight.js-FMU-Compiler/compiler/sources/fmi -I/usr/local/include"
emconfigure: error: './configure "CFLAGS=-Wno-unused-value -Wno-logical-op-parentheses" "CPPFLAGS=-DOMC_MINIMAL_METADATA=1 -I/home/vagrant/Bodylight.js-FMU-Compiler/compiler/sources/fmi -I/usr/local/include"' failed: [Errno 2] No such file or directory: './configure'
make: make -Wno-unused-value
gcc -Os -falign-functions -fno-ipa-pure-const -mstackrealign -msse2 -mfpmath=sse  -DOMC_MINIMAL_RUNTIME=1 -DCMINPACK_NO_DLL=1 -I"C:/Program Files/OpenModelica1.14.1-64bit//include/omc/c/fmi"   -c -o LorenzAttractor.o LorenzAttractor.c
gcc -Os -falign-functions -fno-ipa-pure-const -mstackrealign -msse2 -mfpmath=sse  -DOMC_MINIMAL_RUNTIME=1 -DCMINPACK_NO_DLL=1 -I"C:/Program Files/OpenModelica1.14.1-64bit//include/omc/c/fmi"   -c -o LorenzAttractor_functions.o LorenzAttractor_functions.c
gcc -Os -falign-functions -fno-ipa-pure-const -mstackrealign -msse2 -mfpmath=sse  -DOMC_MINIMAL_RUNTIME=1 -DCMINPACK_NO_DLL=1 -I"C:/Program Files/OpenModelica1.14.1-64bit//include/omc/c/fmi"   -c -o LorenzAttractor_records.o LorenzAttractor_records.c
gcc -Os -falign-functions -fno-ipa-pure-const -mstackrealign -msse2 -mfpmath=sse  -DOMC_MINIMAL_RUNTIME=1 -DCMINPACK_NO_DLL=1 -I"C:/Program Files/OpenModelica1.14.1-64bit//include/omc/c/fmi"   -c -o LorenzAttractor_01exo.o LorenzAttractor_01exo.c
gcc -Os -falign-functions -fno-ipa-pure-const -mstackrealign -msse2 -mfpmath=sse  -DOMC_MINIMAL_RUNTIME=1 -DCMINPACK_NO_DLL=1 -I"C:/Program Files/OpenModelica1.14.1-64bit//include/omc/c/fmi"   -c -o LorenzAttractor_02nls.o LorenzAttractor_02nls.c
gcc -Os -falign-functions -fno-ipa-pure-const -mstackrealign -msse2 -mfpmath=sse  -DOMC_MINIMAL_RUNTIME=1 -DCMINPACK_NO_DLL=1 -I"C:/Program Files/OpenModelica1.14.1-64bit//include/omc/c/fmi"   -c -o LorenzAttractor_03lsy.o LorenzAttractor_03lsy.c
gcc -Os -falign-functions -fno-ipa-pure-const -mstackrealign -msse2 -mfpmath=sse  -DOMC_MINIMAL_RUNTIME=1 -DCMINPACK_NO_DLL=1 -I"C:/Program Files/OpenModelica1.14.1-64bit//include/omc/c/fmi"   -c -o LorenzAttractor_04set.o LorenzAttractor_04set.c
gcc -Os -falign-functions -fno-ipa-pure-const -mstackrealign -msse2 -mfpmath=sse  -DOMC_MINIMAL_RUNTIME=1 -DCMINPACK_NO_DLL=1 -I"C:/Program Files/OpenModelica1.14.1-64bit//include/omc/c/fmi"   -c -o LorenzAttractor_05evt.o LorenzAttractor_05evt.c
gcc -Os -falign-functions -fno-ipa-pure-const -mstackrealign -msse2 -mfpmath=sse  -DOMC_MINIMAL_RUNTIME=1 -DCMINPACK_NO_DLL=1 -I"C:/Program Files/OpenModelica1.14.1-64bit//include/omc/c/fmi"   -c -o LorenzAttractor_06inz.o LorenzAttractor_06inz.c
gcc -Os -falign-functions -fno-ipa-pure-const -mstackrealign -msse2 -mfpmath=sse  -DOMC_MINIMAL_RUNTIME=1 -DCMINPACK_NO_DLL=1 -I"C:/Program Files/OpenModelica1.14.1-64bit//include/omc/c/fmi"   -c -o LorenzAttractor_07dly.o LorenzAttractor_07dly.c
gcc -Os -falign-functions -fno-ipa-pure-const -mstackrealign -msse2 -mfpmath=sse  -DOMC_MINIMAL_RUNTIME=1 -DCMINPACK_NO_DLL=1 -I"C:/Program Files/OpenModelica1.14.1-64bit//include/omc/c/fmi"   -c -o LorenzAttractor_08bnd.o LorenzAttractor_08bnd.c
gcc -Os -falign-functions -fno-ipa-pure-const -mstackrealign -msse2 -mfpmath=sse  -DOMC_MINIMAL_RUNTIME=1 -DCMINPACK_NO_DLL=1 -I"C:/Program Files/OpenModelica1.14.1-64bit//include/omc/c/fmi"   -c -o LorenzAttractor_09alg.o LorenzAttractor_09alg.c
gcc -Os -falign-functions -fno-ipa-pure-const -mstackrealign -msse2 -mfpmath=sse  -DOMC_MINIMAL_RUNTIME=1 -DCMINPACK_NO_DLL=1 -I"C:/Program Files/OpenModelica1.14.1-64bit//include/omc/c/fmi"   -c -o LorenzAttractor_10asr.o LorenzAttractor_10asr.c
gcc -Os -falign-functions -fno-ipa-pure-const -mstackrealign -msse2 -mfpmath=sse  -DOMC_MINIMAL_RUNTIME=1 -DCMINPACK_NO_DLL=1 -I"C:/Program Files/OpenModelica1.14.1-64bit//include/omc/c/fmi"   -c -o LorenzAttractor_11mix.o LorenzAttractor_11mix.c
gcc -Os -falign-functions -fno-ipa-pure-const -mstackrealign -msse2 -mfpmath=sse  -DOMC_MINIMAL_RUNTIME=1 -DCMINPACK_NO_DLL=1 -I"C:/Program Files/OpenModelica1.14.1-64bit//include/omc/c/fmi"   -c -o LorenzAttractor_12jac.o LorenzAttractor_12jac.c
gcc -Os -falign-functions -fno-ipa-pure-const -mstackrealign -msse2 -mfpmath=sse  -DOMC_MINIMAL_RUNTIME=1 -DCMINPACK_NO_DLL=1 -I"C:/Program Files/OpenModelica1.14.1-64bit//include/omc/c/fmi"   -c -o LorenzAttractor_13opt.o LorenzAttractor_13opt.c
gcc -Os -falign-functions -fno-ipa-pure-const -mstackrealign -msse2 -mfpmath=sse  -DOMC_MINIMAL_RUNTIME=1 -DCMINPACK_NO_DLL=1 -I"C:/Program Files/OpenModelica1.14.1-64bit//include/omc/c/fmi"   -c -o LorenzAttractor_14lnz.o LorenzAttractor_14lnz.c
gcc -Os -falign-functions -fno-ipa-pure-const -mstackrealign -msse2 -mfpmath=sse  -DOMC_MINIMAL_RUNTIME=1 -DCMINPACK_NO_DLL=1 -I"C:/Program Files/OpenModelica1.14.1-64bit//include/omc/c/fmi"   -c -o LorenzAttractor_15syn.o LorenzAttractor_15syn.c
gcc -Os -falign-functions -fno-ipa-pure-const -mstackrealign -msse2 -mfpmath=sse  -DOMC_MINIMAL_RUNTIME=1 -DCMINPACK_NO_DLL=1 -I"C:/Program Files/OpenModelica1.14.1-64bit//include/omc/c/fmi"   -c -o LorenzAttractor_16dae.o LorenzAttractor_16dae.c
gcc -Os -falign-functions -fno-ipa-pure-const -mstackrealign -msse2 -mfpmath=sse  -DOMC_MINIMAL_RUNTIME=1 -DCMINPACK_NO_DLL=1 -I"C:/Program Files/OpenModelica1.14.1-64bit//include/omc/c/fmi"   -c -o LorenzAttractor_17inl.o LorenzAttractor_17inl.c
gcc -Os -falign-functions -fno-ipa-pure-const -mstackrealign -msse2 -mfpmath=sse  -DOMC_MINIMAL_RUNTIME=1 -DCMINPACK_NO_DLL=1 -I"C:/Program Files/OpenModelica1.14.1-64bit//include/omc/c/fmi"   -c -o LorenzAttractor_init_fmu.o LorenzAttractor_init_fmu.c
gcc -Os -falign-functions -fno-ipa-pure-const -mstackrealign -msse2 -mfpmath=sse  -DOMC_MINIMAL_RUNTIME=1 -DCMINPACK_NO_DLL=1 -I"C:/Program Files/OpenModelica1.14.1-64bit//include/omc/c/fmi"   -c -o LorenzAttractor_FMU.o LorenzAttractor_FMU.c
In file included from LorenzAttractor_FMU.c:16:0:
fmi-export/fmu2_model_interface.h:34:27: fatal error: fmi2Functions.h: No such file or directory
 #include "fmi2Functions.h"
                           ^
compilation terminated.
make: *** [LorenzAttractor_FMU.o] Error 1
emmake: error: 'make -Wno-unused-value' failed (2)
openmodelica.sh: line 41: ../output/flags: No such file or directory
emcc: error: /home/vagrant/Bodylight.js-FMU-Compiler/compiler/build/fmu/binaries/linux64/LorenzAttractor.so: No such file or directory ("/home/vagrant/Bodylight.js-FMU-Compiler/compiler/build/fmu/binaries/linux64/LorenzAttractor.so" was expected to be an input file, based on the commandline arguments provided)
rm: cannot remove ‘/home/vagrant/Bodylight.js-FMU-Compiler/compiler/build/fmu/LorenzAttractor.js’: No such file or directory
ERROR: compilation unsuccessful, check log for details.

Thanks in advance for any thoughts or advice.

p.s. also if it helps others, the Tools > Options > FMI menu to set the solver for co-simulation is only available from OMEdit 1.18.1, it is not present in 1.18.0.

@AJamesPhillips
Copy link
Author

I added a couple of lines to /home/vagrant/Bodylight.js-FMU-Compiler/compiler/openmodelica.sh before the call to emconfigure ./configure:

cd "$fmu_dir/sources"
cp ./configure.ac ./configure
chmod 777 configure  # needed otherwise it complains about "Permission denied"
emconfigure ./configure \
    CFLAGS='-Wno-unused-value -Wno-logical-op-parentheses' \
    CPPFLAGS="-DOMC_MINIMAL_METADATA=1 -I$sources_dir/fmi -I/usr/local/include"

It now errors with:

failed: [Errno 8] Exec format error: './configure'

@AJamesPhillips
Copy link
Author

I notice at the top of configure.ac it says "Process this file with autoconf to produce a configure script."

@AJamesPhillips
Copy link
Author

I ran sudo yum install autoconf followed by autoconf ./configure.ac (inside the VM) but it errored with:

/usr/bin/m4:configure.ac:179: cannot open `../../../../m4/lapack.m4': No such file or directory
autom4te: /usr/bin/m4 failed with exit status: 1

@AJamesPhillips
Copy link
Author

I don't understand yet how and where the configure.ac gets generated or why it is not already converted to configure. I assume this is something wrong that I have done?

@TomasKulhanek TomasKulhanek self-assigned this Jan 30, 2022
@TomasKulhanek
Copy link
Member

Hi, thanks for reporting. Sorry, the script to compile FMU from OM needs substantial revision as I discovered other subsequent issues, and did not find a solution now.

If you're stuck just with compiling MO to JS, I've tried to create some LorenzAttractor model and exported it from Dymola and compiled to FMU with source codes. The model, fmu and demo as web app can be downloaded from

https://filedn.com/lHGc7w3H4jOpIe46u1nPt57/LorenzAttractor/LorenzAttractorHTMLExport.zip

The demo web app screencast from index.html:

firefox_ttsXky07xv

@AJamesPhillips
Copy link
Author

AJamesPhillips commented Jan 30, 2022

Amazing, thank you Tomas! I'm just using the Lorenz Attractor as a minimal test case to prove OM (Open Modelica Edit) -> JS works. I want to run much large more complex models. Thanks for letting me know it's not functional yet. I don't have much experience of OM or WASM but I am an experienced software engineer so if you have a list of questions / tasks you think I could help with to get this repo to convert FMUs from OM then please share with me and I will do my best to help. I'd love to see this library working for them.

I can see creative-connections/Bodylight.js-FMU-Compiler#4 but I assume the fixes you are referring to are only needed in this repo?
I don't have access to Dymola yet otherwise I would use that instead of OM.

@TomasKulhanek
Copy link
Member

Hi, I've tested on a clean VM (built from fresh sources) - instead of my dirty development VM. And I have following suggestion:

  1. the OM you probably use is on Windows system - it creates FMU with source codes and configuration to be built on Windows system. The Bodylight.js-FMU-Compiler expects FMU with source codes and configuration prepared for Linux system. Unfortunatelly we did not stress it out, that FMU's from openmodelica needs to be generated on linux system. Probably this might be somehow configured in OM on Windows platform too. The compilation FMU-JS fails obviously on it. I suggest to use OM inside VM to create FMU.

  2. I did some changes in compiler/openmodelica.sh script which fails on some other subsequent errors based on FMU with sources generated from OM 1.19.x. This workaround suppress the error of missing __stop_em_asm. I'm not sure whether it is critical, but quick test shows that FMU-JS works and that this JS seems to be fair stable. So I suggest to do git pull inside Bodylight.js-FMU-Compiler directory inside VM.

Any contribution to openmodelica.sh script to fix compilation with CVODE will be very appreciated creative-connections/Bodylight.js-FMU-Compiler#4d :-)

  1. I also did fix the component fmu to be able to detect and initialize JS of FMU from OpenModelica correctly. Seems that its working now too. this will be shortly in some future bodylight-components release.

Updated demo at https://filedn.com/lHGc7w3H4jOpIe46u1nPt57/LorenzAttractor/LorenzAttractorHTMLExport.zip

@AJamesPhillips
Copy link
Author

AJamesPhillips commented Feb 1, 2022

If I use OMEdit on Mac to produce the FMU and use the Bodylight Compiler from inside this virtual machine (using Vagrant and VirtualBox on Mac) then it compiles something that seems right (I'm running into an error now trying to get the Editor to produce a working example similar to the one you've kindly attached above. I'm getting a fmi.js?4fc8:699 error catched during fmu step RuntimeError: abort(Assertion failed: Cannot call unknown function LorenzAttractor_fmi2Instantiate, make sure it is exported) error).

I appreciate the original problem was with running the compiler with an FMU which was produce from the Windows OMEdit. Shall we leave this issue open or would you rather we close it and direct people to using OMEdit from a Mac / Linux or from inside a linux virtual machine?

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