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

FreeBSD: 'fuse/fuse.h' file not found #6

Closed
priyadarshan opened this issue Jan 18, 2018 · 10 comments
Closed

FreeBSD: 'fuse/fuse.h' file not found #6

priyadarshan opened this issue Jan 18, 2018 · 10 comments

Comments

@priyadarshan
Copy link

priyadarshan commented Jan 18, 2018

Please forgive my ignorance of gmake compilation.

I am trying to compile this on FreeBSD 11.1-RELEASE-p4.

I seem to have fuse.h already on my system:

# locate fuse.h
/usr/local/include/fuse/fuse.h
/usr/local/include/fuse.h
/usr/src/sys/arm/nvidia/tegra_efuse.h
/usr/src/sys/fs/fuse/fuse.h

But when I run gmake right after gmake config I get

~/src/hfsfuse # gmake config
echo CC=cc > config.mak
echo CONFIG_CFLAGS=-O3 -std=gnu11  >> config.mak
echo WITH_UBLIO=local >> config.mak
echo WITH_UTF8PROC=local >> config.mak
root@store:~/src/hfsfuse # gmake 
cc -O3 -std=gnu11  -DFUSE_USE_VERSION=28 -D_FILE_OFFSET_BITS=64 -I /root/src/hfsfuse/lib -c -o src/hfsfuse.o src/hfsfuse.c
src/hfsfuse.c:31:10: fatal error: 'fuse/fuse.h' file not found
#include <fuse/fuse.h>
         ^~~~~~~~~~~~~
1 error generated.
gmake: *** [Makefile:60: src/hfsfuse.o] Error 1

How can I make it work?

@0x09
Copy link
Owner

0x09 commented Jan 18, 2018

Thanks, looks like some include flags at this stage were inadvertently lost in a refactoring a bit ago. I just pushed a fix, if you pull the most recent branch this should build again.

@priyadarshan
Copy link
Author

priyadarshan commented Jan 18, 2018

Thank you so much for considering this.

I have pulled latest commit, and now I get this:

# gmake config
echo CC=cc > config.mak
echo CONFIG_CFLAGS=-O3 -std=gnu11  >> config.mak
echo WITH_UBLIO=local >> config.mak
echo WITH_UTF8PROC=local >> config.mak

root@store:~/src/hfsfuse # gmake 
cc -O3 -std=gnu11  -DFUSE_USE_VERSION=28 -D_FILE_OFFSET_BITS=64 -I/usr/local/include -I /root/src/hfsfuse/lib -c -o src/hfsfuse.o src/hfsfuse.c
src/hfsfuse.c:34:10: fatal error: 'version.h' file not found
#include "version.h"
         ^~~~~~~~~~~
1 error generated.
gmake: *** [Makefile:61: src/hfsfuse.o] Error 1

@0x09
Copy link
Owner

0x09 commented Jan 18, 2018

You can run make version to generate this (only needs to be done once), but I'll convert this into a regular make rule that is built with the source files.

@priyadarshan
Copy link
Author

Thanks, and sorry for being slow.

I have done that, and I get:

# gmake version
echo \#define HFSFUSE_VERSION_STRING  > src/version.h

root@store:~/src/hfsfuse # gmake config
echo CC=cc > config.mak
echo CONFIG_CFLAGS=-O3 -std=gnu11  >> config.mak
echo WITH_UBLIO=local >> config.mak
echo WITH_UTF8PROC=local >> config.mak

root@store:~/src/hfsfuse # gmake 
cc -O3 -std=gnu11  -DFUSE_USE_VERSION=28 -D_FILE_OFFSET_BITS=64 -I/usr/local/include -I /root/src/hfsfuse/lib -c -o src/hfsfuse.o src/hfsfuse.c
src/hfsfuse.c:328:10: error: use of undeclared identifier 'ENODATA'
        return -ENODATA;
                ^
1 error generated.
gmake: *** [Makefile:61: src/hfsfuse.o] Error 1

@priyadarshan
Copy link
Author

priyadarshan commented Jan 18, 2018

PS: I have also pulled very latest commit, with same error as above.

@0x09
Copy link
Owner

0x09 commented Jan 18, 2018

Seems that FreeBSD does not support this error, but has a comparable one. I'm not able to test on FreeBSD currently, so these reports are very helpful, thanks! I pushed a change to use the alternative error code on FreeBSD.

@priyadarshan
Copy link
Author

Thanks, it compiles nicely now:

root@store:~/src/hfsfuse # gmake
echo \#define HFSFUSE_VERSION_STRING  > src/version.h
cc -O3 -std=gnu11  -DFUSE_USE_VERSION=28 -D_FILE_OFFSET_BITS=64 -I/usr/local/include -I /root/src/hfsfuse/lib -c -o src/hfsfuse.o src/hfsfuse.c
gmake -C lib/libhfsuser/
gmake[1]: Entering directory '/root/src/hfsfuse/lib/libhfsuser'
cc -O3 -std=gnu11  -DHAVE_BIRTHTIME -I/usr/local/include -DHAVE_UBLIO -DHAVE_UTF8PROC -I /root/src/hfsfuse/lib -c -o cache.o cache.c
cc -O3 -std=gnu11  -DHAVE_BIRTHTIME -I/usr/local/include -DHAVE_UBLIO -DHAVE_UTF8PROC -I /root/src/hfsfuse/lib -c -o features.o features.c
cc -O3 -std=gnu11  -DHAVE_BIRTHTIME -I/usr/local/include -DHAVE_UBLIO -DHAVE_UTF8PROC -I /root/src/hfsfuse/lib -c -o hfsuser.o hfsuser.c
ar rcs libhfsuser.a cache.o features.o hfsuser.o
ranlib libhfsuser.a
gmake[1]: Leaving directory '/root/src/hfsfuse/lib/libhfsuser'
gmake -C lib/libhfs/
gmake[1]: Entering directory '/root/src/hfsfuse/lib/libhfs'
cc -O3 -std=gnu11  -c -o endian.o endian.c
cc -O3 -std=gnu11  -c -o unicode.o unicode.c
cc -O3 -std=gnu11  -c -o libhfs.o libhfs.c
ar rcs libhfs.a endian.o unicode.o libhfs.o
ranlib libhfs.a
gmake[1]: Leaving directory '/root/src/hfsfuse/lib/libhfs'
gmake -C lib/ublio/
gmake[1]: Entering directory '/root/src/hfsfuse/lib/ublio'
cc -g -O2 -Wall -O3 -std=gnu11  -c ublio.c -o ublio.o
ar rcs libublio.a ublio.o
gmake[1]: Leaving directory '/root/src/hfsfuse/lib/ublio'
gmake -C lib/utf8proc/
gmake[1]: Entering directory '/root/src/hfsfuse/lib/utf8proc'
cc -O3 -std=gnu11  -fPIC -std=c99 -Wall -Wmissing-prototypes -pedantic -DUTF8PROC_EXPORTS -c -o utf8proc.o utf8proc.c
rm -f libutf8proc.a
ar rs libutf8proc.a utf8proc.o
ar: warning: creating libutf8proc.a
cc  -shared -o libutf8proc.so.2.0.0 -Wl,-soname -Wl,libutf8proc.so.2 utf8proc.o
chmod a-x libutf8proc.so.2.0.0
ln -f -s libutf8proc.so.2.0.0 libutf8proc.so
ln -f -s libutf8proc.so.2.0.0 libutf8proc.so.2
gmake[1]: Leaving directory '/root/src/hfsfuse/lib/utf8proc'
cc -O3 -std=gnu11  -L/usr/local/lib -o hfsfuse src/hfsfuse.o lib/libhfsuser/libhfsuser.a lib/libhfs/libhfs.a lib/ublio/libublio.a lib/utf8proc/libutf8proc.a -lfuse -lpthread
cc -O3 -std=gnu11  -DFUSE_USE_VERSION=28 -D_FILE_OFFSET_BITS=64 -I/usr/local/include -I /root/src/hfsfuse/lib -c -o src/hfsdump.o src/hfsdump.c
cc -O3 -std=gnu11  -L/usr/local/lib -o hfsdump src/hfsdump.o lib/libhfsuser/libhfsuser.a lib/libhfs/libhfs.a lib/ublio/libublio.a lib/utf8proc/libutf8proc.a -lpthread

This is what I get with `gmake install``

root@store:~/src/hfsfuse # gmake install
gmake -C lib/libhfsuser/
gmake[1]: Entering directory '/root/src/hfsfuse/lib/libhfsuser'
gmake[1]: Nothing to be done for 'all'.
gmake[1]: Leaving directory '/root/src/hfsfuse/lib/libhfsuser'
gmake -C lib/libhfs/
gmake[1]: Entering directory '/root/src/hfsfuse/lib/libhfs'
gmake[1]: Nothing to be done for 'all'.
gmake[1]: Leaving directory '/root/src/hfsfuse/lib/libhfs'
gmake -C lib/ublio/
gmake[1]: Entering directory '/root/src/hfsfuse/lib/ublio'
gmake[1]: 'libublio.a' is up to date.
gmake[1]: Leaving directory '/root/src/hfsfuse/lib/ublio'
gmake -C lib/utf8proc/
gmake[1]: Entering directory '/root/src/hfsfuse/lib/utf8proc'
gmake[1]: Nothing to be done for 'all'.
gmake[1]: Leaving directory '/root/src/hfsfuse/lib/utf8proc'
install hfsfuse /usr/local/bin/

Before I test it copying a large amount of files, am I correct in saying that utf8proc has not been compiled in?

Some of those files use German or Slavic pathnames, so I would need to have utf8proc, right?

Thank you so much.

@0x09
Copy link
Owner

0x09 commented Jan 18, 2018

utf8proc was included, you should also be able to see this by running hfsfuse -v

@priyadarshan
Copy link
Author

Wonderful, thank you.

This is what I get:

hfsfuse -v
hfsfuse version 
Built with:
    FUSE API v2.9
    libhfs RCSID $NetBSD: libhfs.c,v 1.14 2015/06/21 13:40:25 maxv Exp $
    ublio v0.1
    utf8proc v1.3.0

I am going to test it now copying several gigabytes and report back.

Thank you so much for your time, and for hfsfuse.

@priyadarshan
Copy link
Author

After testing on two of our FreeBSD servers, I can confirm hfsfuse works as expected. It is a bit slow (see #8) but otherwise truly a lifesaver.

As far as it concerns me, you could close this ticket if you wish.

Thank you for the help.

@0x09 0x09 closed this as completed Jan 19, 2018
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

2 participants