I am trying to compile sshfs: https://github.com/osxfuse/sshfs
Running the ./configure script outputs:
./configure: line 3676: syntax error near unexpected token `SSHFS,'
./configure: line 3676: `PKG_CHECK_MODULES(SSHFS, fuse >= 2.3 glib-2.0 gthread-2.0)'
So I go here: http://www.gnu.org/software/libc/download.html in order to install libC.
However, I get this message:
*** The GNU C library is currently not available for this platform.
*** So far nobody cared to port it and if there is no volunteer it
*** might never happen. So, if you have interest to see glibc on
*** this platform visit
*** http://www.gnu.org/software/libc/porting.html
*** and join the group of porters
This is after I found out I needed to install other dependencies like gettext, libffi, glib2.
I'm running on a OS X 10.7.1 Lion.
Does this mean I cannot compile SSHFS or am I doing something wrong? It doesn't make sense they would give me the source code for SSHFS on the "Fuse for OSX" website but it doesn't compile on macs.
EDIT:
After installing glib I did the following:
pkg-config --libs --cflags --modversion gthread-2.0
2.38.1
-D_REENTRANT -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -L/usr/local/lib -lgthread-2.0 -lglib-2.0 -lintl
This proves I have gthread-2.0.
I also did:
pkg-config --libs --cflags --modversion glib-2.0
2.38.1
-I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -L/usr/local/lib -lglib-2.0 -lintl
This proves I have glib-2.0.
but I still get the error message on line 3676 above saying PKG_CHECK_MODULES unexpected token "sshfs". Does this mean something is wrong with the PKG_CHECK_MODULES macro?
Do not confuse GNU C Library (glibC) and Glib (GLib is a general-purpose utility library).
What do you really need is to install Glib (not GlibC) on your MacOS. Please follow the manual which you will find on their web site, it will provide you with the steps how to install it on your MacOS.
Related
Update: I got it working, the problem has something to do with the fact that I was running it through emacs. I ran the makefile from the command line instead, and pkg-config ran. After adding the path to guile-2.0.pc with export PKG_CONFIG_PATH=/opt/local/lib/pkgconfig everything compiled and ran OK. Still won't compile through emacs but I don't want to deal with that.
I am trying to compile a C program but received a "pkg-config: command not found" error, but am pretty sure pkg-config is installed.
Below is the MAKEFILE
# Use GCC, if you have it installed.
CC=gcc
# Tell the C compiler where to find <libguile.h>
CFLAGS=`pkg-config --cflags guile-2.0`
# Tell the linker what libraries to use and where to find them.
LIBS=`pkg-config --libs guile-2.0`
simple-guile: simple-guile.o
${CC} simple-guile.o ${LIBS} -o simple-guile
simple-guile.o: test.c
${CC} -c ${CFLAGS} test.c
Below is the error message (re: second error, I think if I can resolve this issue the libguile.h file will be found)
make
gcc -c `pkg-config --cflags guile-2.0` test.c
/bin/sh: pkg-config: command not found
test.c:2:11: fatal error: 'libguile.h' file not found
#include <libguile.h>
^
1 error generated.
make: *** [simple-guile.o] Error 1
I installed pkg-config by
brew install pkg-config
Installation appears successful?...
Jeffs-iMac:~ Jeff$ which pkg-config
/opt/local/bin/pkg-config
If it's relevant, this should be the same directory in which guile is located:
Jeffs-iMac:~ Jeff$ which guile
/opt/local/bin/guile
Am using OS X 10.11.3
I tried uninstalling and reinstalling pkg-config per: Can't install rmagick, pkg-config: command not found
I'm a novice programmer, any help would be greatly appreciated.
I'd like to install a third-party C library (http://cgm.cs.mcgill.ca/~avis/C/lrs.html) on a Mac OS X. However, the binaries won't seem to install on a Mac OS X (10.9.5). The library is intended for Unix/Linux platforms.
Here are a couple example of errors I get when trying to install the make file. First, here's the error when running make all out of the box (for some reason, running make all64 does nothing):
ld: library not found for -lgmp
I installed the GMP library (https://gmplib.org/) via MacPorts in /opt/local. However, the library does not appear to be found:
cc 2nash-GMP.o -L. -llrsgmp -L/opt/local/include -lgmp -o 2nash
ld: library not found for -lgmp
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [2nash] Error 1
rm 2nash-GMP.o
How can I get around all this and install on a Mac?
I'll mention that I intend to call a function from this C library many, many times within functions from some (Matlab) code I've written. I'd prefer any potential solution to allow for this.
Update #1:
I've since done the following:
In the makefile, changed LIBDIR from /usr/lib to /opt/local/lib
In the makefile, changed INCLUDEDIR from /usr/include to /opt/local/include
Copied gmp.h file from /opt/local/include to /usr/include
In the makefile, changed RANLIB ?= /bin/true to RANLIB ?= /usr/bin/true
Now, when I run make all, I get the following message:
make: Nothing to be done for `all'.
What other steps should be taken?
I think you would, instead, want something like:
cc 2nash-GMP.o -L. -llrsgmp -I/opt/local/include -L/opt/local/lib -lgmp -o 2nash
The -I option specifies a path to headers to include. The -L option specifies a path to library files to include.
Change the variable LIBDIR in the makefile to the location where the libraries are installed, e.g.:
LIBDIR = /opt/local/lib
I installed pkg-config
and added pkg-config -cppflags and pkg-config --libs in build setting
please help
I am working on windows 8 and eclipse kepler
14:58:32 **** Incremental Build of configuration Debug for project Hi_c_gtk ****
make all
Building file: ../src/Hi_c_gtk.c
Invoking: Cross GCC Compiler
gcc -O0 -g3 -Wall -c -fmessage-length=0 pkg-config gtkmm-2.4 --cflags -MMD -MP -MF"src/Hi_c_gtk.d" -MT"src/Hi_c_gtk.d" -o "src/Hi_c_gtk.o" "../src/Hi_c_gtk.c"
cygwin warning:
MS-DOS style path detected: C:\Users\Project\workspace1\Hi_c_gtk\Debug
Preferred POSIX equivalent is: /cygdrive/c/Users/Project/workspace1/Hi_c_gtk/Debug
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
gcc: error: pkg-config: No such file or directory
gcc: error: gtkmm-2.4: No such file or directory
gcc: error: unrecognized command line option ‘--cflags’
src/subdir.mk:18: recipe for target 'src/Hi_c_gtk.o' failed
make: *** [src/Hi_c_gtk.o] Error 1
I understand you're trying to integrate GTK with Eclipse on Windows.
I've recently managed to achieve so in both GNU/Linux and Windows environments. On GNU/Linux it was as easy as install pkg-config from the Eclipse marketplace and adding needed libraries.
On Windows tough, I had to configure include paths manually by modifying compiler options. You need to add manually all includes and libraries requested by GTK+ on Project-C/C++ Build-Settings. I used Cygwin's gcc.
The full process is described on http://irkedrants.blogspot.com.es/2011/02/configuring-eclipse-to-compile-gtk.html
I'm trying to compile the following project on a remote server.
I've git cloned the project on a folder called 'scode'.
The project requires glib2 and gsl libraries. Since I'm trying to compile on a remote server, I do not have sudo privileges. So I can't use a tool to install glib2 and gsl for me.
As a result, I've manually compiled both gsl and gslib2 under the folders 'scode/gsl' and 'scode/glib'.
I've had to modify the Makefile and add absolute paths to these directories as -I options.
Nonetheless, when I try to compile the final executable. I get the following error:
[dyuret#psglogin scode]$ make
gcc -O3 -D_GNU_SOURCE -Wall -std=c99 -I. -I /home-2/dyuret/scode/gsl
-I /home-2/dyuret/scode/glib/ pkg-config --cflags glib-2.0 scode.o svec.o pkg-config --libs glib-2.0 -lm -lgsl -lgslcblas -o scode
//home-2/dyuret/scode/glib/glib/libglib-2.0.la: file not recognized:
File format not recognized
collect2: error: ld returned 1 exit status make: * [scode] Error 1
I've researched the issue a bit. This link looks informative but I can't quite decipher what the author is saying, as I'm not that experienced with compilers, libtools and the compilation flow in general.
Any help would be much appreciated. I've already spent some time on this issue and I haven't been able to make much progress.
It sounds as if what you did in order to compile the libraries in non-default (i.e. non-system) locations was maybe wrong.
For packages using autoconf (i.e. that have a configure script in the source root) you're supposed to use the --prefix option to ./configure to set the target location where you want the package installed.
With packages building shared libraries, it's often essential to do the make install step, which it sounds as if you maybe didn't do.
Sorry for being vague, these things are a bit complicated.
Someone at my group helped me with the problem. Here're the steps he roughly carried out:
(1) Manually installed glib and additional libraries at $HOME directory - i.e. $HOME/lib, $HOME/include.
(1.1) I think he did this by './configure prefix=$HOME', 'make', 'make install'.
(2) Got rid of `pkg_config` usage, which was causing the problem I outlined originally. Here are his new CLFAGS and LIBS variables:
CFLAGS=-O3 -D_GNU_SOURCE -Wall -std=c99 -I. -I$$HOME/include -I$$HOME/include/glib-2.0 -I$$HOME/lib/glib-2.0/include
LIBS=-lglib-2.0 -lm -lgsl -lgslcblas -L$$HOME/lib -L/usr/local/cuda/lib64 -lcudart
After this, the code compiled without additional problems.
I'm trying to compile a program written in C. ./configure was successful, but when I did make, it gave me an error. I did make check, and it said:
gcc -g -Wall -static -o multipht multipht.o multimatch.o multiweight.o multiwrite.o multisort.o multiclean.o
/usr/bin/ld: cannot find -lc
collect2: ld returned 1 exit status
("multipht" is the name of the program I'm trying to install.)
Could anyone tell me what the problem is?
Your system appears to not have a statically linkable C library. That's actually pretty common these days. Take off the -static flag and you should be good to go.
On Fedora, the static version of glibc is in the glibc-static package.
sudo yum -y install glibc-devel glibc-static