Coder Social home page Coder Social logo

6.2.2007 throws an error about netgen HOT 14 CLOSED

ngsolve avatar ngsolve commented on August 26, 2024
6.2.2007 throws an error

from netgen.

Comments (14)

davydden avatar davydden commented on August 26, 2024

with the source code the same issue happens at the end of the installation phase:

-- Installing: /blahblah/netgen/lib/python3.7/site-packages/netgen/read_gmsh.py
terminate called after throwing an instance of 'std::invalid_argument'
  what():  stoi
CMake Error at python/cmake_install.cmake:59 (file):
...

I can also confirm that this happens with gcc 8.3.0 and gcc 7.4.0, thus unlikely to be related to the compiler version.

from netgen.

iwetuan avatar iwetuan commented on August 26, 2024

hi @davydden 我遇到相同的问题,问题出现在 cmake/generate_version_file.cmake,他期望的输入是这样的格式
v6.2.2004-25-gefbd71c8 但是我的git describe --tag --long 返回的 v6.2-dev-xx-xxx,

问题出现在
string(REGEX REPLACE "^v([0-9]+)\.." "\1" NETGEN_VERSION_MAJOR "${git_version_string}")
string(REGEX REPLACE "^v[0-9]+\.([0-9]+).
" "\1" NETGEN_VERSION_MINOR "${git_version_string}")
string(REGEX REPLACE "^v[0-9]+\.[0-9]+\.([0-9]+)." "\1" NETGEN_VERSION_PATCH "${git_version_string}")
string(REGEX REPLACE "^v[0-9]+\.[0-9]+\.[0-9]+\-([0-9]+).
" "\1" NETGEN_VERSION_TWEAK "${git_version_string}")
string(REGEX REPLACE "^v[0-9]+\.[0-9]+\.[0-9]+\-[0-9]+\-([0-9a-z]+).*" "\1" NETGEN_VERSION_HASH "${git_version_string}")

正则匹配执行 仅仅匹配
v6.2.2004-25-gefbd71c8
但是不能
v6.2-dev-xx-xxx

也需可以这样解决问题
set(git_version_string "v6.2.2007-25-gefbd71c8")

from netgen.

iwetuan avatar iwetuan commented on August 26, 2024

thanks fanyi.baidu.com

I have the same problem with cmake / generate_ version_ file.cmake He expects the input to be in this format

V6.2.2004-25-gefbd71c8, but my git describe -- tag -- long returns v6.2-dev-xx-xxx,

The problem is

string(REGEX REPLACE "^v([0-9]+).." "\1" NETGEN_ VERSION_ MAJOR "${git_ version_ string}")

string(REGEX REPLACE "^v[0-9]+.([0-9]+)." "\1" NETGEN_ VERSION_ MINOR "${git_ version_ string}")

string(REGEX REPLACE "^v[0-9]+.[0-9]+.([0-9]+)." "\1" NETGEN_ VERSION_ PATCH "${git_ version_ string}")

string(REGEX REPLACE "^v[0-9]+.[0-9]+.[0-9]+-([0-9]+)." "\1" NETGEN_ VERSION_ TWEAK "${git_ version_ string}")

string(REGEX REPLACE "^v[0-9]+.[0-9]+.[0-9]+-[0-9]+-([0-9a-z]+).*" "\1" NETGEN_ VERSION_ HASH "${git_ version_ string}")

Regular matching performs only matching

v6.2.2004-25-gefbd71c8

But it can't

v6.2-dev-xx-xxx

It also needs to be able to solve the problem in this way

set(git_ version_ string "v6.2.2007-25-gefbd71c8")

from netgen.

iwetuan avatar iwetuan commented on August 26, 2024

You may also need to remove your_build_dir/netgen/netgen_version.hpp then rebuild!

from netgen.

mhochsteger avatar mhochsteger commented on August 26, 2024

@davydden @iwetuan

Hi both,
How did you obtain the source code? Please post the output of
git remote -v
and
git tag

Best,
Matthias

from netgen.

iwetuan avatar iwetuan commented on August 26, 2024

hi @mhochsteger 这是我的输出

dbn@debian:~/Desktop/FET/netgen-mesher-git$ git remote -v
origin https://git.code.sf.net/p/netgen-mesher/git (fetch)
origin https://git.code.sf.net/p/netgen-mesher/git (push)

dbn@debian:~/Desktop/FET/netgen-mesher-git$ git tag
v6.2-dev

from netgen.

davydden avatar davydden commented on August 26, 2024

Hi @mhochsteger ,

I check out tag 6.2.2007 (commit 6eaeccc) from github https://github.com/NGSolve/ngsolve.git .

from netgen.

mhochsteger avatar mhochsteger commented on August 26, 2024

@iwetuan
Ah, I see that tags were not pushed to sourceforge. That's fixed now, a 'git pull' followed by a rebuild should solve your issue.

@davydden
Your issue is different, since your netgen source are fetched from github.
Did you run 'git submodule update --recursive' after checking out 6.2.2007 in NGSolve?
What's your output of
git remote -v
git tag
git show
in your_ngsolve_source/external_dependencies/netgen ?

from netgen.

iwetuan avatar iwetuan commented on August 26, 2024

@mhochsteger thanks! it works.

from netgen.

davydden avatar davydden commented on August 26, 2024

@mhochsteger Apologies, I confused the repos, I actually checkout it from the netgen https://github.com/NGSolve/netgen . But still, the same tag. Importantly, the issue is not there for 6.2.2006, as I mentioned in the OP.

from netgen.

davydden avatar davydden commented on August 26, 2024

@mhochsteger 6.2.2008 does show this issue anymore.

from netgen.

davydden avatar davydden commented on August 26, 2024

@mhochsteger @JSchoeberl interestingly enough, this is NOT an netgen issue, but NGSolve. When I install the 6.2.2008 stack and set environment for netgen only, then netgen --version is ok:

netgen --version
NETGEN-6.2.2008
Developed by Joachim Schoeberl at
2010-xxxx Vienna University of Technology
2006-2010 RWTH Aachen University
1996-2006 Johannes Kepler University Linz
Including MPI version 3.1
Problem in Tk_Init: 
result = no display name and no $DISPLAY environment variable
optfile ./ng.opt does not exist - using default values
togl-version : 2
no OpenGL

When I set environment for ngsolve 6.2.2008 (and netgen), then everything works as expected as well:

netgen --version
NETGEN-6.2.2008
Developed by Joachim Schoeberl at
2010-xxxx Vienna University of Technology
2006-2010 RWTH Aachen University
1996-2006 Johannes Kepler University Linz
Including MPI version 3.1
Problem in Tk_Init: 
result = no display name and no $DISPLAY environment variable
optfile ./ng.opt does not exist - using default values
togl-version : 2
no OpenGL
loading ngsolve library
NGSolve-6.2.2008
Using Lapack
Including sparse direct solver UMFPACK
Running parallel using 64 thread(s)

Finally when I set environment to the ngsolve 6.2.2008` patched with NGSolve/ngsolve@3f0092a , then we get an error:

netgen --version
NETGEN-6.2.2008
Developed by Joachim Schoeberl at
2010-xxxx Vienna University of Technology
2006-2010 RWTH Aachen University
1996-2006 Johannes Kepler University Linz
Including MPI version 3.1
Problem in Tk_Init: 
result = no display name and no $DISPLAY environment variable
optfile ./ng.opt does not exist - using default values
togl-version : 2
no OpenGL
loading ngsolve library
terminate called after throwing an instance of 'std::invalid_argument'
  what():  stoi

By diffing build logs I noticed the following difference:

NGSolve 6.2.2008:  Automatic configuration OK.

vs

  NGSolve ........-..-..:  Automatic configuration OK.

Which brings me to the conclusion that at some point you are trying to output a version from an empty string. A catch of std::invalid_argument is missing somewhere. Would you be so kind to have a closer look. It must be a one-liner fix.

from netgen.

davydden avatar davydden commented on August 26, 2024

@mhochsteger @JSchoeberl I looked closer into generate_version_file to see that ngsolve relies on the presence of .git to determine the version if it's not build from a tag. I have been using a package manager to check-out the sources with a shallow copy --depth 1 and thus .git was absent. As soon as I let the .git be around, the version is picked-up as intended. Thus it's not a ngsolve issue.

I would still suggest to either catch std::invalid_argument or throw an error at the cmake stage if the version was not picked up correctly for some reason.

from netgen.

AlexLuya avatar AlexLuya commented on August 26, 2024

@davydden ,Hello,this bug has never been fixed,and I have to add this line to netgen/cmake/generate_version_file.cmake always

set(NETGEN_VERSION 6.2.0-6.2.0.0-6.2.0.0)
set(NETGEN_VERSION_LONG 6.2.0-6.2.0.0-6.2.0.0})
set(NETGEN_VERSION_GIT 6.2.0-6.2.0.0-6.2.0.0)
set(NETGEN_VERSION_TWEAK 6.2.0.0)

By deleting the 'v' charactor from 6.2.0-v6.2.0.0-v6.2.0.0

from netgen.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.