Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
Pierre-Henri Wuillemin
@phwuill_gitlab
For clang ans omp, I do not think any of us did know that ... Googling a bit, I found that https://stackoverflow.com/questions/66663120/fatal-error-omp-h-file-not-found-using-clang-on-apple-m1 ... But I have no clue for now ... Did you try to find omp.h in the clang's folder ?
Alessandro Savino
@xavier7179

Hi @xavier7179 , this error is quite weird since BinaryJoinTreeConverterDefaut(...) has not been changed for a while ...
Did you recompile your old project ? Do you have several versions of aGrUM installed in different places ?

actually yes, I recompiled everything and since I installed it using homebrew, only one version remains in the system... I also print the full verbose version of the command and everything seems right in terms of libraries... that one is only one of the many part that it does not link properly... it looks the static compilation of the library did not included everything

Pierre-Henri Wuillemin
@phwuill_gitlab

If the tests are OK, I think that the library is quite complete. The test coverage is not so bad and particularly for the BN's inference and especially for the LazyPropagation which is one of the most used algorithms in aGrUM ...

Can you find a minimal code that causes such linking errors so that we can test it ourselves ?

Alessandro Savino
@xavier7179
I debugged the installation further, during the linking of CXX static library all .o come out "has no symbols"... is it as expected?
Pierre-Henri Wuillemin
@phwuill_gitlab
do you see the same when compiling the tests ?
Pierre-Henri Wuillemin
@phwuill_gitlab
Hi again @xavier7179, I just succeeded in compiling and running the tests and the sample project in apps/aGrUM/HowToBuildSimpleBN on my mac book pro. I do not how to help you with your problem... Maybe you can share a minimized version of your project ?
Alessandro Savino
@xavier7179
actually, I noticed something strange. The installation ask for a static library, while the python act test release aGrUM -t all recompiles everything but the library is a dynamic one (and then the test are all just fine)
Pierre-Henri Wuillemin
@phwuill_gitlab
did you use the option "--static" ?
I can create such a static library and I can compile my HowToBuildSimpleBN against it ...
image.png
Pierre-Henri Wuillemin
@phwuill_gitlab
Just to be sure, I compiled aGrUM's tests against dynamic or static agrum's lib :
The first one (27422256 octets) is against .dynlib and the second one (39524344 octests) is against .a... Both are working correctly
By the way, the message about .o having no symbols is normal : a major part of aGrUM is template (or inlined) and then are compiled with the application and does not create any symbol in the library ...
image.png
Alessandro Savino
@xavier7179
As you can check in the Homebrew formula, I used the https://agrum.gitlab.io/pages/install-agrum-mac-os.html instructions to generate the formula. So the commando to generate the library is python act install release aGrUM --static -d INSTALL_PATH. The formula runs the hash table test to very the installation. In order to check it even further, I downloaded it and check everything by hand, thus I also run the act test part
what XCode version are you using as compile reference?
Pierre-Henri Wuillemin
@phwuill_gitlab
I do not have any xcode version (as far as I know :-) ), but homebrew ask me to xcode-select --install from time to time (command line tools). I am using MacOS Big Sur 11.3 (xcode-select version 2384.)
Pierre-Henri Wuillemin
@phwuill_gitlab
This is the correct command line for static library. Removing --static generates a .dynlib...
You can try and look at build/release/src/gumTest. You will see the difference in the size when compiling with or without --static
Alessandro Savino
@xavier7179

I found the 'bug'. If keep the suggested openmp include:

find_package(OpenMP)
if (OPENMP_FOUND)
    set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
    set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
else (OPENMP_FOUND)
    message(FATAL "OpenMP not found")
endif(OPENMP_FOUND)

it does not link.

Pierre-Henri Wuillemin
@phwuill_gitlab
OK and yes, we need openMP ... and you saw this FATAL "OpenMP not found" ?
Alessandro Savino
@xavier7179
Actually not at all. The problem is that it enters in OPENMP_FOUND corretly but:
  1. during the compilation of the library it prints:
    -- Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES)
    -- Could NOT find OpenMP_CXX (missing: OpenMP_CXX_FLAGS OpenMP_CXX_LIB_NAMES)
    -- Could NOT find OpenMP (missing: OpenMP_C_FOUND OpenMP_CXX_FOUND)
  2. on a program:
    -- Found OpenMP_C: -Xclang -fopenmp (found version "5.0") 
    -- Found OpenMP_CXX: -Xclang -fopenmp (found version "5.0") 
    -- Found OpenMP: TRUE (found version "5.0")
    and I get Undefined sysmbols kind of errors
Pierre-Henri Wuillemin
@phwuill_gitlab
So the library found OpenMP_FOUND TRUE but OpenMP_C_FOUND and OpenMP_CPP_FOUND missing. And the program found everything TRUE ? What does the program's CMakeLists.txt ?
(I cannot reproduce this here, sorry)
Alessandro Savino
@xavier7179

So the library found OpenMP_FOUND TRUE but OpenMP_C_FOUND and OpenMP_CPP_FOUND missing. And the program found everything TRUE ? What does the program's CMakeLists.txt ?
(I cannot reproduce this here, sorry)

the program CMakeLists does what I wrote previously (the openMP search and link is the same...):

find_package(OpenMP)
if (OPENMP_FOUND)
    set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
    set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
else (OPENMP_FOUND)
    message(FATAL "OpenMP not found")
endif(OPENMP_FOUND)
`
AugustoPedron
@AugustoPedron
Hi, I just discovered your library and I was trying to compile it (I'm on Windows) using "python act test release aGrUM -t all" but at the end it returns "ZERO_CHECK.vcxproj : error MSB4057 : the target "gumTest" does not exist in the project. I also tried using "python act install release --mvsc -d INSTALL_PATH" but it also results in error "act: error: no such option --mvsc". What am I doing wrong?
Pierre-Henri Wuillemin
@phwuill_gitlab
image.png

Hi Augusto,

  • the option for windows has been changed at some point. You should use :
    python act install ... --windows=mvsc19
    (python act --help will show you that you can use mvsc19 | mvsc19_32 | mvsc17 | mvsc17_32 | mvsc15 | mvsc15_32 | mingw64) .

  • the action 'test' is quite sensible on windows especially for pyAgrum. However for aGrUM, it works (at least on our computers)... Maybe with the same option --windows=mvsc19 ?

I guess some documentations are not up to date if you found the flag '--mvsc' ... Could you tell me where is this page/documentation ?

Pierre-Henri Wuillemin
@phwuill_gitlab
AugustoPedron
@AugustoPedron
It worked perfectly. Thank you!
AugustoPedron
@AugustoPedron
Hi, after having solved my compilation problems, I'm now trying to use the library as described in the docs. Since I'm on windows after doing "cmake ../src/", I open the .sln file and try to compile it. But then I get a bunch of errors (100+) and the first is: "PCH warning: header stop not at file scope. An IntelliSense PCH file was not generated" when I do "#include <agrum/BN/BayesNet.h>" or any other include related to BN. The initial tutorial, where only the hash table is included, works fine. How can I solve it?
Pierre-Henri Wuillemin
@phwuill_gitlab

Hi Augusto, as far as I know, even with windows, we compile using msbuild in the terminal.

Googling a bit, I found this https://vsf-prod.westus.cloudapp.azure.com/content/problem/200436/pch-warning-header-stop-not-a-file-scope-an-intell.html ... ???

However this is just a warning (no PCH generated) but not an error... Could you show us the first errors ?

AugustoPedron
@AugustoPedron
error.png
Pierre-Henri Wuillemin
@phwuill_gitlab

Weird ... Definitively, BNReade, BayersNet, BayesNetFactory are templates ... :-) And there is no illegal '(' in graphElement_inl.h:53 ...

(which version of VC++ ?)

Maybe you could share a very simple project that fails ?

AugustoPedron
@AugustoPedron
The versione of vc++ used in visual studio is c++14 but I've installed up to c++20 on my pc
the project that fails is the same that is described here: https://webia.lip6.fr/~phw//aGrUM/docs/last/doxygen/db/db6/using_agrum.html. Just adding "#include <agrum/BN/BayesNet.h>" is enough, in my case, to have those errors
error_code.png
Pierre-Henri Wuillemin
@phwuill_gitlab
OK !! Really very strange ... I will try asap.
AugustoPedron
@AugustoPedron
Thank you!
Pierre-Henri Wuillemin
@phwuill_gitlab
Hi Augusto, even with the simple project with HashTable only, I have very strange errors that I do not understand.
Pierre-Henri Wuillemin
@phwuill_gitlab
image.png
Pierre-Henri Wuillemin
@phwuill_gitlab
ok, now I have the same problem as you. Even with msbuild.exe in the command line. And I do not see any difference between the process to build gumTest.exe (which is working) and the process to build the toy program...
AugustoPedron
@AugustoPedron
the error _iterator_debuglevel regards the fact that agrum is built as release and your test project is in debug. just put release as well in the configuration of the test project

Hi Augusto, even with the simple project with HashTable only, I have very strange errors that I do not understand.

yeah the example with just hashTable runs fine, the problem is if i include <agrum/BN/BayesNet.h>

Pierre-Henri Wuillemin
@phwuill_gitlab

OK, i found it ! :-)

We forgot to add some special flags for visualC++ when installing aGrUM on windows. For now, if you add this lines on your CMakeLists.txt

if (MSVC)
    set (CMAKE_CXX_FLAGS "/DNOMINMAX /bigobj /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE /MP ${CMAKE_CXX_FLAGS}")
    set (CMAKE_C_FLAGS "/DNOMINMAX /bigobj /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE /MP ${CMAKE_C_FLAGS}")
endif()

Then generate the sln file with

cmake ..  -DCMAKE_BUILD_TYPE=Release -G "Visual Studio 16 2019" -A x64

it should be OK (at least, It works for me :-) ).

image.png

This is fixed and will be in the next release (soon, hopefully) !

image.png

AugustoPedron
@AugustoPedron
It worked perfectly! Thank you
AugustoPedron
@AugustoPedron
I also found out that the documentation describing how to use probabilistic inference is not on par with the latest version of agrum (probably you forgot to update it). it says to use the copy constructor of ShaferShenoyInference that is deleted, while it should be used as "gum::ShaferShenoyInference<double>(&bn)"
AugustoPedron
@AugustoPedron
sorry i wrote it wrong, it should be "gum::ShaferShenoyInference<double> inference (&bn)"
Pierre-Henri Wuillemin
@phwuill_gitlab
Hi @AugustoPedron, you are right. Actually, I think that those copy constructors should be re-activated ... But for now, I will change the snippet. Thanks !
nojhan
@nojhan:matrix.org
[m]
Hi. There's a pyAgrum.lib.ipython module, but it's not documented in the RTD. I'm trying to do something like gip.showBN(bn);plt.show() but it does not dispaly anything, what am I missing?