Skip to content

Fix build issues and add install instructions#246

Open
mhanberry1 wants to merge 2 commits into
NGSolve:masterfrom
mhanberry1:fix-build
Open

Fix build issues and add install instructions#246
mhanberry1 wants to merge 2 commits into
NGSolve:masterfrom
mhanberry1:fix-build

Conversation

@mhanberry1

Copy link
Copy Markdown

On ubuntu and other linux distributions, the tcl/tk headers are installed in /usr/include/tcl, which is not discoverable by the current CMake configuration.

I've fixed this by adding the necessary include directories to CMakeLists.txt in a way that shouldn't interfere with other systems.

The content of the INSTALL file was also incorrect, so I removed it and added build instructions to README.md. Currently, only the ubuntu system dependencies are listed, but more systems can be added as needed.

@francesco-ballarin

Copy link
Copy Markdown
Contributor

I am in no way officially affiliated to the project, but I am among the Debian maintainers for it.

The change to TCL_INCLUDE_PATH doesn't feel right. In Debian, we do not need to tweak the include path in any way, see
https://salsa.debian.org/science-team/netgen/-/blob/master/debian/rules?ref_type=heads#L28-42
for netgen to build.
The Ubuntu package is based on Debian's one, and doesn't make any noticeable change in the build configuration, hence I would expect that you should be able to build on Ubuntu without any changes to CMakeLists.txt.

You may want to compare the packages you have installed to the one reported at
https://salsa.debian.org/science-team/netgen/-/blob/master/debian/control?ref_type=heads#L11-39
and see if you have anything missing.

Also note that TCL is requested at

find_package(TCL 8.5 REQUIRED)

so that should be enough to populate TCL_INCLUDE_PATH

@mhanberry1

Copy link
Copy Markdown
Author

@francesco-ballarin I'm not sure why find_package(TCL 8.5 REQUIRED) isn't working, but the build fails to find tcl on a vanilla version of ubuntu. Even if the version is changed to 8.6, which is the only version available in the ubuntu repositories, the lookup fails to locate tcl/tk headers.

I've created a Dockerfile that you can use to replicate this issue:

from ubuntu

run apt update && apt install -y python-is-python3 pip
run pip install --break-system-packages scikit-build requests netgen-occt-devel
run apt install -y git cmake tcl-dev tk-dev libglu1-mesa-dev libxmu-dev

run git clone https://github.com/NGSolve/netgen.git
run pip install --break-system-packages ./netgen

The build fails with this error:

1038.6       /netgen/ng/Togl2.1/togl.h:46:12: fatal error: tcl.h: No such file or directory
1038.6          46 | #  include <tcl.h>

@francesco-ballarin

Copy link
Copy Markdown
Contributor

Not sure what to say. In the same docker image the minimal cmake file

# cat CMakeLists.txt 
cmake_minimum_required(VERSION 4.2)
find_package(TCL 8.5 REQUIRED)

results in

# grep -i TCL_INCLUDE CMakeCache.txt 
TCL_INCLUDE_PATH:PATH=/usr/include/tcl
//ADVANCED property for variable: TCL_INCLUDE_PATH
TCL_INCLUDE_PATH-ADVANCED:INTERNAL=1

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

Successfully merging this pull request may close these issues.

2 participants