wildmeshing / fTetWild

Fast Tetrahedral Meshing in the Wild
https://yixin-hu.github.io/ftetwild.pdf
Mozilla Public License 2.0
425 stars 83 forks source link

Ubuntu cannot find gmp #34

Open JerryYan97 opened 3 years ago

JerryYan97 commented 3 years ago

Hello,

When I try to install gmp on Ubuntu by using this command: sudo apt-get install gmp

it says: Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package gmp

Does anyone know what's wrong here?

Thanks!

hph73 commented 3 years ago

I installed gmp on ubuntu with this command sudo apt-get install libgmp3-dev.

teseoch commented 3 years ago

is the installation in the path?

Cmake is looking in these env vars: GMP_INC and GMP_LIB

hph73 commented 3 years ago

See the official instruction below.

Note if cmake cannot find gmp you need to export the envirnement variable GMP_INC and GMP_LIB to the folder where you installed (e.g., \Library\include for GMP_INC and \Library\lib for GMP_LIB).

DamrongGuoy commented 1 year ago

Previously I did sudo apt-get install gmp and got the same errors:

$ sudo apt install gmp
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package gmp

Then, cmake gave errors about GMP_INC and GMP_LIB:

$ cmake ..
...
-- Could NOT find GMP (missing: GMP_INCLUDE_DIRS GMP_LIBRARIES) 
-- GMP libs: GMP_LIBRARIES-NOTFOUND GMP_INCLUDE_DIRS-NOTFOUND
CMake Error at CMakeLists.txt:81 (MESSAGE):
  Cannot find GMP

Thanks to @hph73, the alternative command sudo apt-get install libgmp3-dev worked for me. I didn't have to set GMP_INC, GMP_LIB myself. It just works!

$ sudo apt-get install libgmp3-dev
$ cmake ..
$ make

It built successfully after 5 minutes with a number of compiler warnings (shadowed declarations, enumeration values not handled, assume signed overflow not occur).

fTetWild/build (master)$ ./FloatTetwild_bin --help
6 10 12 2 9 5 16 13 0 14 4 1 19 8 18 11 3 17 15 7 
float-tetwild
Usage: ./FloatTetwild_bin [OPTIONS]

Options:
  -h,--help                   Print this help message and exit
  -i,--input TEXT:FILE        Input surface mesh INPUT in .off/.obj/.stl/.ply format. (string, required)
  -o,--output TEXT            Output tetmesh OUTPUT in .msh format. (string, optional, default: input_file+postfix+'.msh')
  --tag TEXT:FILE             Tag input faces for Boolean operation.
  --op INT                    Boolean operation: 0: union, 1: intersection, 2: difference.
  -l,--lr FLOAT               ideal_edge_length = diag_of_bbox * L. (double, optional, default: 0.05)
  -e,--epsr FLOAT             epsilon = diag_of_bbox * EPS. (double, optional, default: 1e-3)
  --max-its INT               (for debugging usage only)
  --stop-energy FLOAT         Stop optimization when max energy is lower than this.
  --stage INT                 (for debugging usage only)
  --stop-p INT                (for debugging usage only)
  --postfix TEXT              (for debugging usage only)
  --log TEXT                  Log info to given file.
  --level INT                 Log level (0 = most verbose, 6 = off).
  -q,--is-quiet               Mute console output. (optional)
  --skip-simplify             skip preprocessing.
  --no-binary                 export meshes as ascii
  --no-color                  don't export color
  --not-sort-input            (for debugging usage only)
  --correct-surface-orientation
                              (for debugging usage only)
  --envelope-log TEXT         (for debugging usage only)
  --smooth-open-boundary      Smooth the open boundary.
  --export-raw                Export raw output.
  --manifold-surface          Force the output to be manifold.
  --coarsen                   Coarsen the output as much as possible.
  --csg TEXT:FILE             json file containg a csg tree
  --use-old-energy            (for debugging usage only)
  --disable-filtering         Disable filtering out outside elements.
  --use-floodfill             Use flood-fill to extract interior volume.
  --use-general-wn            Use general winding number.
  --use-input-for-wn          Use input surface for winding number.
  --bg-mesh TEXT:FILE         Background mesh for sizing field (.msh file).
  --max-threads UINT          Maximum number of threads used

Thank you!

foxhank commented 1 month ago

I installed gmp on ubuntu with this command sudo apt-get install libgmp3-dev.

It works on Debian 12.6,thanks!

root@iZbp1hf1xgc6al1n6v6yxzZ:~# sudo apt-get install libgmp-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  libgmpxx4ldbl
Suggested packages:
  gmp-doc libgmp10-doc libmpfr-dev
The following NEW packages will be installed:
  libgmp-dev libgmpxx4ldbl
0 upgraded, 2 newly installed, 0 to remove and 30 not upgraded.
Need to get 979 kB of archives.
After this operation, 2,258 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://mirrors.cloud.aliyuncs.com/debian bookworm/main amd64 libgmpxx4ldbl amd64 2:6.2.1+dfsg1-1.1 [338 kB]
Get:2 http://mirrors.cloud.aliyuncs.com/debian bookworm/main amd64 libgmp-dev amd64 2:6.2.1+dfsg1-1.1 [641 kB]
Fetched 979 kB in 0s (2,893 kB/s)
Selecting previously unselected package libgmpxx4ldbl:amd64.
(Reading database ... 64734 files and directories currently installed.)
Preparing to unpack .../libgmpxx4ldbl_2%3a6.2.1+dfsg1-1.1_amd64.deb ...
Unpacking libgmpxx4ldbl:amd64 (2:6.2.1+dfsg1-1.1) ...
Selecting previously unselected package libgmp-dev:amd64.
Preparing to unpack .../libgmp-dev_2%3a6.2.1+dfsg1-1.1_amd64.deb ...
Unpacking libgmp-dev:amd64 (2:6.2.1+dfsg1-1.1) ...
Setting up libgmpxx4ldbl:amd64 (2:6.2.1+dfsg1-1.1) ...
Setting up libgmp-dev:amd64 (2:6.2.1+dfsg1-1.1) ...
Processing triggers for libc-bin (2.36-9+deb12u8) ...