Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
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?
nojhan
@nojhan:matrix.org
[m]
I don't see any pyAgrum.lib.image module either… what is the recommended way of plotting outside of a notebook?
Pierre-Henri Wuillemin
@phwuill_gitlab
Hi, to use pyAgrum.lib.image, you need to update pyAgrum (0.22.2). And it is somewhat documented here : https://pyagrum.readthedocs.io/en/0.22.2/lib.image.html
nojhan
@nojhan:matrix.org
[m]
@phwuill_gitlab: Thanks, did not noticed that detail. (is it normal that I do not see the pyAgrum.lib.notebook module in 0.22.2?)
Pierre-Henri Wuillemin
@phwuill_gitlab
hi @nojhan:matrix.org , no, it is not normal at all :
image.png
nojhan
@nojhan:matrix.org
[m]
I got puzzled by the import scheme, I guess. Here you can see that one don't see the lib sub-module from the main import, but it still can be imported directly.
Pierre-Henri Wuillemin
@phwuill_gitlab

hum weird. puzzled here too :-)

pyAgrum.lib is a regular package with its own (empty) __init__.py file ...

nojhan
@nojhan:matrix.org
[m]
I'm using 0.22.2, installed with ./act install release pyAgrum
Pierre-Henri Wuillemin
@phwuill_gitlab
I do not think it has to do with the version but with the organization of pyAgrum (?)
image.png
nojhan
@nojhan:matrix.org
[m]
I never saw this kind of behaviour…
with Python in general, I mean.
Pierre-Henri Wuillemin
@phwuill_gitlab
I guess something is not pythonic enough in our codes ... I will check a bit. If you have any clue ... :-)
nojhan
@nojhan:matrix.org
[m]
I'm struggling to find the interface of Potential that would allow to set the scalar probabilities one by one by simply providing the source node of the arc, a state and the related probability, is there a simple way to do that? Something like bn.cpt(node)[{source:0}] = [p1,p2] (which does not work because it seems to expect the full set of source arcs)
Pierre-Henri Wuillemin
@phwuill_gitlab
I do not understand. If you have a function f(X,Y,Z), how to populate this function using f[{X:0}]=[0.1, 0.9] ? There is a clash in the dimension (shape) in this affectation.
nojhan
@nojhan:matrix.org
[m]
Indeed. But I would want to be able to populate it items by items.
Pierre-Henri Wuillemin
@phwuill_gitlab
Could you give an example ?
nojhan
@nojhan:matrix.org
[m]
Actually, I think I understood my mistake, sorry for the noise 🙂
Pierre-Henri Wuillemin
@phwuill_gitlab
:+1: