Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ubuntu cannot find gmp #34

Open
JerryYan97 opened this issue Jan 27, 2021 · 5 comments
Open

Ubuntu cannot find gmp #34

JerryYan97 opened this issue Jan 27, 2021 · 5 comments

Comments

@JerryYan97
Copy link

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
Copy link

hph73 commented Feb 8, 2021

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

@teseoch
Copy link
Collaborator

teseoch commented Feb 15, 2021

is the installation in the path?

Cmake is looking in these env vars: GMP_INC and GMP_LIB

@hph73
Copy link

hph73 commented Apr 27, 2021

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., <conda_dir>\Library\include for GMP_INC and <conda_dir>\Library\lib for GMP_LIB).

@DamrongGuoy
Copy link

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
Copy link

foxhank commented Oct 11, 2024

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) ...

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

No branches or pull requests

5 participants