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

Configuration fails to find libtiff-4 system library #16

Closed
benz0li opened this issue Jan 28, 2024 · 14 comments · Fixed by #17
Closed

Configuration fails to find libtiff-4 system library #16

benz0li opened this issue Jan 28, 2024 · 14 comments · Fixed by #17
Labels
bug Something isn't working

Comments

@benz0li
Copy link
Contributor

benz0li commented Jan 28, 2024

Describe the bug

devtools::install() complains that it cannot find ibtiff-4 although libtiff-dev is installed on the system (Debian 12).

To Reproduce

GitHub Codespaces: https://codespaces.new/benz0li/unigd?hide_repo_select=true&ref=add-dev-container

radian
devtools::install()
── R CMD build ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
✔  checking for file ‘/workspaces/unigd/DESCRIPTION’ ...
─  preparing ‘unigd’:
✔  checking DESCRIPTION meta-information ...
─  cleaning src
─  running ‘cleanup’
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
─  building ‘unigd_0.1.0.tar.gz’
   Warning: file 'unigd/cleanup' did not have execute permissions: corrected
   Warning: file 'unigd/configure' did not have execute permissions: corrected
   
Running /usr/local/lib/R/bin/R CMD INSTALL /tmp/Rtmp8xVDte/unigd_0.1.0.tar.gz --install-tests 
* installing to library ‘/home/vscode/R/x86_64-pc-linux-gnu-library/4.3’
* installing *source* package ‘unigd’ ...
** using staged installation
Found pkg-config cflags and libs!
Using PKG_CFLAGS=-I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 
Using PKG_LIBS=-lcairo -lfreetype 
Using PKG_LIBTIFF_CFLAGS=-I/usr/include/x86_64-linux-gnu 
Using PKG_LIBTIFF_LIBS=-ltiff  -ltiffxx 
------------------------------[ WARNING ]---------------------------
Info: Configuration failed to find libtiff-4 system library.
httpgd is fully functional without libtiff-4, but some plot file formats
will not be available.
If you want to install libtiff-4 see below error for troubleshooting.
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because libtiff-4 was not found. Try installing:
 * deb: libtiff-dev (Debian, Ubuntu, etc)
 * rpm: libtiff-devel (Fedora, EPEL)
 * brew: libtiff (OSX)
If libtiff-4 is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a libtiff-4.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
--------------------------------------------------------------------
** libs
...

Expected behavior

configure should be able to find the TIFF library files.

Screenshots

-

Environment

  • OS: Debian 12
  • Architectrue: x86_64
  • R version: 4.3.2
  • unigd version: 0.1.0

Additional context

-

@benz0li benz0li added the bug Something isn't working label Jan 28, 2024
@nx10
Copy link
Owner

nx10 commented Jan 28, 2024

Thanks! This is also tracked in nx10/httpgd#130

@benz0li
Copy link
Contributor Author

benz0li commented Jan 28, 2024

Thanks! This is also tracked in nx10/httpgd#130

OK


libtiff test configuration does not work as expected:

configure.log

src/sysdep_tests/sysdep_libtiff.cpp: In function ‘int main()’:
src/sysdep_tests/sysdep_libtiff.cpp:5:11: warning: unused variable ‘tiff’ [-Wunused-variable]
    5 |     TIFF *tiff = TIFFStreamOpen("memory", &tiff_ostream);
      |           ^~~~
/usr/bin/ld: /tmp/cc49Gs4W.o: in function `main':
/workspaces/unigd/src/sysdep_tests/sysdep_libtiff.cpp:5: undefined reference to `TIFFStreamOpen(char const*, std::ostream*)'
collect2: error: ld returned 1 exit status

@benz0li
Copy link
Contributor Author

benz0li commented Jan 28, 2024

Either

unigd/configure

Line 117 in 4a88d66

${CXX} ${CPPFLAGS} ${PKG_LIBTIFF_CFLAGS} ${CFLAGS} ${PKG_LIBTIFF_TEST_FILE} -o tmp_libtiff_test >/dev/null 2>configure.log

or

#include <sstream>
#include <tiffio.hxx>
int main() {
std::ostringstream tiff_ostream;
TIFF *tiff = TIFFStreamOpen("memory", &tiff_ostream);
return 0;
}

is wrong.

@benz0li
Copy link
Contributor Author

benz0li commented Jan 28, 2024

Using

${CXX} ${CPPFLAGS} ${PKG_LIBTIFF_CFLAGS} ${CFLAGS} ${PKG_LIBTIFF_TEST_FILE} -o tmp_libtiff_test || true >/dev/null 2>configure.log

unigd compiles just fine with TIFF support.

benz0li added a commit to benz0li/unigd that referenced this issue Jan 29, 2024
This was referenced Jan 29, 2024
@nx10 nx10 closed this as completed in #17 Feb 5, 2024
@wurli
Copy link

wurli commented Apr 11, 2024

Hi, unfortunately I'm still getting this issue, despite having libtiff 4.6.0 installed on macOS Ventura. Happy to dig into the advice in the error message if this is intended behaviour, but based on this conversation I don't think it is:

If libtiff-4 is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a libtiff-4.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
Full installation log

❯ Rscript -e "pak::pak('nx10/unigd')"
✔ Loading metadata database ... done

→ Will install 1 package.
→ The package (0 B) is cached.
+ unigd   0.1.1 👷🏾‍♂️🔧 (GitHub: dc46f97)
ℹ No downloads are needed, 1 pkg is cached
ℹ Building unigd 0.1.1
✖ Failed to build unigd 0.1.1
Error:
! error in pak subprocess
Caused by error in `stop_task_build(state, worker)`:
! Failed to build source package 'unigd'
Full installation output:
* installing *source* package ‘unigd’ ...
staged installation is only possible with locking
** using non-staged installation
Homebrew 4.2.17
Using PKG_CFLAGS=-I/opt/homebrew/include/cairo -I/opt/homebrew/include/fontconfig -I/opt/homebrew/include/freetype2
Using PKG_LIBS=-L/opt/homebrew/lib -lcairo -lfreetype
------------------------------[ CAIRO ]---------------------------------
Info: Configuration failed to find cairo system library.
httpgd is fully functional without cairo, but some plot file formats
will not be available.
If you want to install cairo see below error for troubleshooting.
-----------------------------[ ANTICONF ]-------------------------------
Configuration failed to find libraries. Try installing:
 * deb: libcairo2-dev (Debian, Ubuntu)
 * rpm: cairo-devel (Fedora, CentOS, RHEL)
 * csw: libcairo_dev (Solaris)
 * brew: cairo (OSX)
If --static cairo freetype2 are already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a --static cairo freetype2.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
---------------------------[ ERROR MESSAGE ]----------------------------
In file included from src/sysdep_tests/sysdep_cairo.c:1:
/opt/homebrew/include/cairo/cairo-ft.h:50:10: fatal error: 'fontconfig/fontconfig.h' file not found
#include <fontconfig/fontconfig.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
------------------------------------------------------------------------
Using PKG_LIBTIFF_CFLAGS=
Using PKG_LIBTIFF_LIBS=-ltiff -ljpeg
------------------------------[ WARNING ]---------------------------
Info: Configuration failed to find libtiff-4 system library.
httpgd is fully functional without libtiff-4, but some plot file formats
will not be available.
If you want to install libtiff-4 see below error for troubleshooting.
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because libtiff-4 was not found. Try installing:
 * deb: libtiff-dev (Debian, Ubuntu, etc)
 * rpm: libtiff-devel (Fedora, EPEL)
 * brew: libtiff (OSX)
If libtiff-4 is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a libtiff-4.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
--------------------------------------------------------------------
** libs
rm -f unigd.so base_64.o compress.o cpp11.o draw_data.o page_store.o plot_history.o r_thread_posix.o r_thread_win32.o renderer_cairo.o renderer_json.o renderer_meta.o renderer_strings.o renderer_svg.o renderer_tikz.o renderers.o unigd.o unigd_dev.o unigd_external.o uuid.o
clang++ -mmacosx-version-min=10.13 -std=gnu++14 -I"/Library/Frameworks/R.framework/Versions/4.2/Resources/include" -DNDEBUG -DUNIGD_NO_CAIRO -DUNIGD_NO_TIFF -Ilib -I../inst/include -DFMT_HEADER_ONLY -I'/Library/Frameworks/R.framework/Versions/4.2/Resources/library/cpp11/include' -I'/Library/Frameworks/R.framework/Versions/4.2/Resources/library/systemfonts/include' -I/usr/local/include   -fPIC  -Wall -g -O2  -Wall -pedantic -fdiagnostics-color=always -c base_64.cpp -o base_64.o
base_64.cpp:7:10: fatal error: 'png.h' file not found
#include <png.h>
         ^~~~~~~
1 error generated.
make: *** [base_64.o] Error 1
ERROR: compilation failed for package ‘unigd’

@benz0li
Copy link
Contributor Author

benz0li commented Apr 11, 2024

/opt/homebrew/include/cairo/cairo-ft.h:50:10: fatal error: 'fontconfig/fontconfig.h' file not found

@wurli Install fontconfig (and maybe libpng).

@wurli
Copy link

wurli commented Apr 11, 2024

Thank you, both installed already unfortunately 🙁

@benz0li
Copy link
Contributor Author

benz0li commented Apr 11, 2024

Thank you, both installed already unfortunately 🙁

@wurli You have two fatal errors:

/opt/homebrew/include/cairo/cairo-ft.h:50:10: fatal error: 'fontconfig/fontconfig.h' file not found

base_64.cpp:7:10: fatal error: 'png.h' file not found

Both are unrelated to tiff.

@benz0li
Copy link
Contributor Author

benz0li commented Apr 11, 2024

@wurli What about cairo and freetype? Are those installed, too?

@wurli
Copy link

wurli commented Apr 11, 2024

@benz0li Thanks again. Yeah, cairo and freetype are both installed...

@benz0li
Copy link
Contributor Author

benz0li commented Apr 11, 2024

@wurli Out of curiosity: Does

devtools::install_github("nx10/unigd")

work?

@wurli
Copy link

wurli commented Apr 11, 2024

@benz0li Still no luck unfortunately. There's is some additional information - I think install_github() also tries to update {systemfonts} and gets an error compiling. I'm currently using {systemfonts} 1.0.5 though, which is above the minimum required version 1.0.0. Besides that I think the rest of the messages are the same:

Full installation log
❯ Rscript -e "devtools::install_github('nx10/unigd')"
Downloading GitHub repo nx10/unigd@HEAD
systemfonts (1.0.5 -> 1.0.6) [CRAN]
Installing 1 packages: systemfonts

  There is a binary version available but the source version is later:
            binary source needs_compilation
systemfonts  1.0.5  1.0.6              TRUE

installing the source package ‘systemfonts’

trying URL 'https://cloud.r-project.org/src/contrib/systemfonts_1.0.6.tar.gz'
Content type 'application/x-gzip' length 80844 bytes (78 KB)
==================================================
downloaded 78 KB

* installing *source* package ‘systemfonts’ ...
** package ‘systemfonts’ successfully unpacked and MD5 sums checked
** using staged installation
Homebrew 4.2.17
Using PKG_CFLAGS=-I/opt/homebrew/include -I/opt/homebrew/include/freetype2
Using PKG_LIBS=-lfreetype
** libs
rm -f systemfonts.so caches.o cpp11.o dev_metrics.o font_matching.o font_registry.o ft_cache.o string_shape.o font_metrics.o font_fallback.o string_metrics.o emoji.o cache_store.o init.o mac/FontManagerMac.o
clang++ -mmacosx-version-min=10.13 -std=gnu++14 -I"/Library/Frameworks/R.framework/Versions/4.2/Resources/include" -DNDEBUG -I/opt/homebrew/include -I/opt/homebrew/include/freetype2 -I'/Library/Frameworks/R.framework/Versions/4.2/Resources/library/cpp11/include' -I/usr/local/include   -fPIC  -Wall -g -O2  -c caches.cpp -o caches.o
clang++ -mmacosx-version-min=10.13 -std=gnu++14 -I"/Library/Frameworks/R.framework/Versions/4.2/Resources/include" -DNDEBUG -I/opt/homebrew/include -I/opt/homebrew/include/freetype2 -I'/Library/Frameworks/R.framework/Versions/4.2/Resources/library/cpp11/include' -I/usr/local/include   -fPIC  -Wall -g -O2  -c cpp11.cpp -o cpp11.o
clang++ -mmacosx-version-min=10.13 -std=gnu++14 -I"/Library/Frameworks/R.framework/Versions/4.2/Resources/include" -DNDEBUG -I/opt/homebrew/include -I/opt/homebrew/include/freetype2 -I'/Library/Frameworks/R.framework/Versions/4.2/Resources/library/cpp11/include' -I/usr/local/include   -fPIC  -Wall -g -O2  -c dev_metrics.cpp -o dev_metrics.o
clang++ -mmacosx-version-min=10.13 -std=gnu++14 -I"/Library/Frameworks/R.framework/Versions/4.2/Resources/include" -DNDEBUG -I/opt/homebrew/include -I/opt/homebrew/include/freetype2 -I'/Library/Frameworks/R.framework/Versions/4.2/Resources/library/cpp11/include' -I/usr/local/include   -fPIC  -Wall -g -O2  -c font_matching.cpp -o font_matching.o
clang++ -mmacosx-version-min=10.13 -std=gnu++14 -I"/Library/Frameworks/R.framework/Versions/4.2/Resources/include" -DNDEBUG -I/opt/homebrew/include -I/opt/homebrew/include/freetype2 -I'/Library/Frameworks/R.framework/Versions/4.2/Resources/library/cpp11/include' -I/usr/local/include   -fPIC  -Wall -g -O2  -c font_registry.cpp -o font_registry.o
clang++ -mmacosx-version-min=10.13 -std=gnu++14 -I"/Library/Frameworks/R.framework/Versions/4.2/Resources/include" -DNDEBUG -I/opt/homebrew/include -I/opt/homebrew/include/freetype2 -I'/Library/Frameworks/R.framework/Versions/4.2/Resources/library/cpp11/include' -I/usr/local/include   -fPIC  -Wall -g -O2  -c ft_cache.cpp -o ft_cache.o
clang++ -mmacosx-version-min=10.13 -std=gnu++14 -I"/Library/Frameworks/R.framework/Versions/4.2/Resources/include" -DNDEBUG -I/opt/homebrew/include -I/opt/homebrew/include/freetype2 -I'/Library/Frameworks/R.framework/Versions/4.2/Resources/library/cpp11/include' -I/usr/local/include   -fPIC  -Wall -g -O2  -c string_shape.cpp -o string_shape.o
clang++ -mmacosx-version-min=10.13 -std=gnu++14 -I"/Library/Frameworks/R.framework/Versions/4.2/Resources/include" -DNDEBUG -I/opt/homebrew/include -I/opt/homebrew/include/freetype2 -I'/Library/Frameworks/R.framework/Versions/4.2/Resources/library/cpp11/include' -I/usr/local/include   -fPIC  -Wall -g -O2  -c font_metrics.cpp -o font_metrics.o
clang++ -mmacosx-version-min=10.13 -std=gnu++14 -I"/Library/Frameworks/R.framework/Versions/4.2/Resources/include" -DNDEBUG -I/opt/homebrew/include -I/opt/homebrew/include/freetype2 -I'/Library/Frameworks/R.framework/Versions/4.2/Resources/library/cpp11/include' -I/usr/local/include   -fPIC  -Wall -g -O2  -c font_fallback.cpp -o font_fallback.o
clang++ -mmacosx-version-min=10.13 -std=gnu++14 -I"/Library/Frameworks/R.framework/Versions/4.2/Resources/include" -DNDEBUG -I/opt/homebrew/include -I/opt/homebrew/include/freetype2 -I'/Library/Frameworks/R.framework/Versions/4.2/Resources/library/cpp11/include' -I/usr/local/include   -fPIC  -Wall -g -O2  -c string_metrics.cpp -o string_metrics.o
clang++ -mmacosx-version-min=10.13 -std=gnu++14 -I"/Library/Frameworks/R.framework/Versions/4.2/Resources/include" -DNDEBUG -I/opt/homebrew/include -I/opt/homebrew/include/freetype2 -I'/Library/Frameworks/R.framework/Versions/4.2/Resources/library/cpp11/include' -I/usr/local/include   -fPIC  -Wall -g -O2  -c emoji.cpp -o emoji.o
clang++ -mmacosx-version-min=10.13 -std=gnu++14 -I"/Library/Frameworks/R.framework/Versions/4.2/Resources/include" -DNDEBUG -I/opt/homebrew/include -I/opt/homebrew/include/freetype2 -I'/Library/Frameworks/R.framework/Versions/4.2/Resources/library/cpp11/include' -I/usr/local/include   -fPIC  -Wall -g -O2  -c cache_store.cpp -o cache_store.o
clang++ -mmacosx-version-min=10.13 -std=gnu++14 -I"/Library/Frameworks/R.framework/Versions/4.2/Resources/include" -DNDEBUG -I/opt/homebrew/include -I/opt/homebrew/include/freetype2 -I'/Library/Frameworks/R.framework/Versions/4.2/Resources/library/cpp11/include' -I/usr/local/include   -fPIC  -Wall -g -O2  -c init.cpp -o init.o
clang++ -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Versions/4.2/Resources/include" -DNDEBUG -I/opt/homebrew/include -I/opt/homebrew/include/freetype2 -I'/Library/Frameworks/R.framework/Versions/4.2/Resources/library/cpp11/include' -I/usr/local/include  -fobjc-arc -fPIC   -c mac/FontManagerMac.mm -o mac/FontManagerMac.o
clang++ -mmacosx-version-min=10.13 -std=gnu++14 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Versions/4.2/Resources/lib -L/usr/local/lib -o systemfonts.so caches.o cpp11.o dev_metrics.o font_matching.o font_registry.o ft_cache.o string_shape.o font_metrics.o font_fallback.o string_metrics.o emoji.o cache_store.o init.o mac/FontManagerMac.o -lfreetype -framework CoreText -framework Foundation -F/Library/Frameworks/R.framework/Versions/4.2 -framework R -Wl,-framework -Wl,CoreFoundation
ld: library not found for -lfreetype
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [systemfonts.so] Error 1
ERROR: compilation failed for package ‘systemfonts’
* removing ‘/Library/Frameworks/R.framework/Versions/4.2/Resources/library/systemfonts’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/4.2/Resources/library/systemfonts’

The downloaded source packages are in
	‘/private/var/folders/q3/yvp6hh456f75189plgmjjgkm0000gn/T/RtmpSNkUJb/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
── R CMD build ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
✔  checking for file ‘/private/var/folders/q3/yvp6hh456f75189plgmjjgkm0000gn/T/RtmpSNkUJb/remotes1df211c468e/nx10-unigd-dc46f97/DESCRIPTION’ ...
─  preparing ‘unigd’:
✔  checking DESCRIPTION meta-information ...
─  cleaning src
─  running ‘cleanup’
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
─  building ‘unigd_0.1.1.tar.gz’

* installing *source* package ‘unigd’ ...
** using staged installation
Homebrew 4.2.17
Using PKG_CFLAGS=-I/opt/homebrew/include/cairo -I/opt/homebrew/include/fontconfig -I/opt/homebrew/include/freetype2
Using PKG_LIBS=-L/opt/homebrew/lib -lcairo -lfreetype
------------------------------[ CAIRO ]---------------------------------
Info: Configuration failed to find cairo system library.
httpgd is fully functional without cairo, but some plot file formats
will not be available.
If you want to install cairo see below error for troubleshooting.
-----------------------------[ ANTICONF ]-------------------------------
Configuration failed to find libraries. Try installing:
 * deb: libcairo2-dev (Debian, Ubuntu)
 * rpm: cairo-devel (Fedora, CentOS, RHEL)
 * csw: libcairo_dev (Solaris)
 * brew: cairo (OSX)
If --static cairo freetype2 are already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a --static cairo freetype2.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
---------------------------[ ERROR MESSAGE ]----------------------------
In file included from src/sysdep_tests/sysdep_cairo.c:1:
/opt/homebrew/include/cairo/cairo-ft.h:50:10: fatal error: 'fontconfig/fontconfig.h' file not found
#include <fontconfig/fontconfig.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
------------------------------------------------------------------------
Using PKG_LIBTIFF_CFLAGS=
Using PKG_LIBTIFF_LIBS=-ltiff -ljpeg
------------------------------[ WARNING ]---------------------------
Info: Configuration failed to find libtiff-4 system library.
httpgd is fully functional without libtiff-4, but some plot file formats
will not be available.
If you want to install libtiff-4 see below error for troubleshooting.
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because libtiff-4 was not found. Try installing:
 * deb: libtiff-dev (Debian, Ubuntu, etc)
 * rpm: libtiff-devel (Fedora, EPEL)
 * brew: libtiff (OSX)
If libtiff-4 is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a libtiff-4.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
--------------------------------------------------------------------
** libs
rm -f unigd.so base_64.o compress.o cpp11.o draw_data.o page_store.o plot_history.o r_thread_posix.o r_thread_win32.o renderer_cairo.o renderer_json.o renderer_meta.o renderer_strings.o renderer_svg.o renderer_tikz.o renderers.o unigd.o unigd_dev.o unigd_external.o uuid.o
clang++ -mmacosx-version-min=10.13 -std=gnu++14 -I"/Library/Frameworks/R.framework/Versions/4.2/Resources/include" -DNDEBUG -DUNIGD_NO_CAIRO -DUNIGD_NO_TIFF -Ilib -I../inst/include -DFMT_HEADER_ONLY -I'/Library/Frameworks/R.framework/Versions/4.2/Resources/library/cpp11/include' -I'/Library/Frameworks/R.framework/Versions/4.2/Resources/library/systemfonts/include' -I/usr/local/include   -fPIC  -Wall -g -O2  -c base_64.cpp -o base_64.o
base_64.cpp:7:10: fatal error: 'png.h' file not found
#include <png.h>
         ^~~~~~~
1 error generated.
make: *** [base_64.o] Error 1
ERROR: compilation failed for package ‘unigd’
* removing ‘/Library/Frameworks/R.framework/Versions/4.2/Resources/library/unigd’
Warning messages:
1: In i.p(...) :
  installation of package ‘systemfonts’ had non-zero exit status
2: In i.p(...) :
  installation of package ‘/var/folders/q3/yvp6hh456f75189plgmjjgkm0000gn/T//RtmpSNkUJb/file1df26a4ffaf7/unigd_0.1.1.tar.gz’ had non-zero exit status

~ took 23s

@benz0li
Copy link
Contributor Author

benz0li commented Apr 11, 2024

@wurli Try

devtools::install_github("nx10/unigd", upgrade = FALSE)

@wurli
Copy link

wurli commented Apr 11, 2024

Same issues as before I think 🙁:

Full installation log
❯ Rscript -e 'devtools::install_github("nx10/unigd", upgrade = FALSE)'
Downloading GitHub repo nx10/unigd@HEAD
── R CMD build ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
✔  checking for file ‘/private/var/folders/q3/yvp6hh456f75189plgmjjgkm0000gn/T/Rtmp9Y3Kjw/remotes21581b84c3b6/nx10-unigd-dc46f97/DESCRIPTION’ ...
─  preparing ‘unigd’:
✔  checking DESCRIPTION meta-information ...
─  cleaning src
─  running ‘cleanup’
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
─  building ‘unigd_0.1.1.tar.gz’

* installing *source* package ‘unigd’ ...
** using staged installation
Homebrew 4.2.17
Using PKG_CFLAGS=-I/opt/homebrew/include/cairo -I/opt/homebrew/include/fontconfig -I/opt/homebrew/include/freetype2
Using PKG_LIBS=-L/opt/homebrew/lib -lcairo -lfreetype
------------------------------[ CAIRO ]---------------------------------
Info: Configuration failed to find cairo system library.
httpgd is fully functional without cairo, but some plot file formats
will not be available.
If you want to install cairo see below error for troubleshooting.
-----------------------------[ ANTICONF ]-------------------------------
Configuration failed to find libraries. Try installing:
 * deb: libcairo2-dev (Debian, Ubuntu)
 * rpm: cairo-devel (Fedora, CentOS, RHEL)
 * csw: libcairo_dev (Solaris)
 * brew: cairo (OSX)
If --static cairo freetype2 are already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a --static cairo freetype2.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
---------------------------[ ERROR MESSAGE ]----------------------------
In file included from src/sysdep_tests/sysdep_cairo.c:1:
/opt/homebrew/include/cairo/cairo-ft.h:50:10: fatal error: 'fontconfig/fontconfig.h' file not found
#include <fontconfig/fontconfig.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
------------------------------------------------------------------------
Using PKG_LIBTIFF_CFLAGS=
Using PKG_LIBTIFF_LIBS=-ltiff -ljpeg
------------------------------[ WARNING ]---------------------------
Info: Configuration failed to find libtiff-4 system library.
httpgd is fully functional without libtiff-4, but some plot file formats
will not be available.
If you want to install libtiff-4 see below error for troubleshooting.
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because libtiff-4 was not found. Try installing:
 * deb: libtiff-dev (Debian, Ubuntu, etc)
 * rpm: libtiff-devel (Fedora, EPEL)
 * brew: libtiff (OSX)
If libtiff-4 is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a libtiff-4.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
--------------------------------------------------------------------
** libs
rm -f unigd.so base_64.o compress.o cpp11.o draw_data.o page_store.o plot_history.o r_thread_posix.o r_thread_win32.o renderer_cairo.o renderer_json.o renderer_meta.o renderer_strings.o renderer_svg.o renderer_tikz.o renderers.o unigd.o unigd_dev.o unigd_external.o uuid.o
clang++ -mmacosx-version-min=10.13 -std=gnu++14 -I"/Library/Frameworks/R.framework/Versions/4.2/Resources/include" -DNDEBUG -DUNIGD_NO_CAIRO -DUNIGD_NO_TIFF -Ilib -I../inst/include -DFMT_HEADER_ONLY -I'/Library/Frameworks/R.framework/Versions/4.2/Resources/library/cpp11/include' -I'/Library/Frameworks/R.framework/Versions/4.2/Resources/library/systemfonts/include' -I/usr/local/include   -fPIC  -Wall -g -O2  -c base_64.cpp -o base_64.o
base_64.cpp:7:10: fatal error: 'png.h' file not found
#include <png.h>
         ^~~~~~~
1 error generated.
make: *** [base_64.o] Error 1
ERROR: compilation failed for package ‘unigd’
* removing ‘/Library/Frameworks/R.framework/Versions/4.2/Resources/library/unigd’
Warning message:
In i.p(...) :
  installation of package ‘/var/folders/q3/yvp6hh456f75189plgmjjgkm0000gn/T//Rtmp9Y3Kjw/file2158746d80a1/unigd_0.1.1.tar.gz’ had non-zero exit status

~ took 8s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants