fdict icon indicating copy to clipboard operation
fdict copied to clipboard

problem with install

Open kyrtle opened this issue 5 years ago • 19 comments

Hello, I am not sure if this is the right place but I am asking for help as I am stuck with final install process of fdict. I am on a macOS 10.15 using zsh. make has created a libfdict.a without any error. I have used the gfortran.make file provided in the arch-makes directory with optional flags and openmpi flag ON (default and debugging flags OFF). Running install I am getting the following error message:

mkdir -p ~/FORT/fdict/include
mkdir -p ~/FORT/fdict/lib
mkdir -p ~/FORT/fdict/bin
install-sh -m 755 -t ~/FORT/fdict/lib libfdict.a
/bin/sh: install-sh: command not found
make: *** [smeka-install-lib] Error 127

Will you please help? My best regards, Tamoghna

kyrtle avatar Nov 17 '20 22:11 kyrtle

Right place ;)

Sadly, I don't have a mac to test this on. The problem is that the install-sh command does not exist on your mac.

Could you figure out if you have install (i.e. do which install)

Alternatively you can install coreutils

brew install coretutils

that should fix this (hopefully).

zerothi avatar Nov 18 '20 08:11 zerothi

Thank you for your reply and I am really sorry for replying back only now. I found install as in /usr/bin/install and also installed coreutils but the problem persists. I shall try it on Ubuntu and keep you posted. Regards, dT

kyrtle avatar Nov 25 '20 17:11 kyrtle

Thank you for your reply and I am really sorry for replying back only now. I found install as in /usr/bin/install and also installed coreutils but the problem persists. I shall try it on Ubuntu and keep you posted. Regards, dT

Ok, could yo uthen do:

make INSTALL=install

I think this would work?

zerothi avatar Nov 25 '20 18:11 zerothi

Ammmm.... It still throws up the following error: mkdir -p /Users/yeoljunghan/fdict/include mkdir -p /Users/yeoljunghan/fdict/lib mkdir -p /Users/yeoljunghan/fdict/bin install -m 755 -t /Users/yeoljunghan/fdict/lib libfdict.a install: illegal option -- t usage: install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode] [-o owner] file1 file2 install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode] [-o owner] file1 ... fileN directory install -d [-v] [-g group] [-m mode] [-o owner] directory ... make: *** [smeka-install-lib] Error 64

Tamoghna Das Center for Soft and Living Matter Institute for Basic Sciences, Ulsan 50 UNIST-Gil, Eonyang-eup, Ulju-gun Ulsan, Republic of Korea 44919

On Thu, Nov 26, 2020 at 3:37 AM Nick Papior [email protected] wrote:

Thank you for your reply and I am really sorry for replying back only now. I found install as in /usr/bin/install and also installed coreutils but the problem persists. I shall try it on Ubuntu and keep you posted. Regards, dT

Ok, could yo uthen do:

make INSTALL=install

I think this would work?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/zerothi/fdict/issues/24#issuecomment-733883313, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQYN5PQI2CV27ZBHNDVB3F3SRVFF3ANCNFSM4TZEXIAQ .

kyrtle avatar Nov 26 '20 13:11 kyrtle

Ok, could you try and apply this patch:

diff --git a/Makefile.project b/Makefile.project
index 29dfb07..0c2b8fa 100644
--- a/Makefile.project
+++ b/Makefile.project
@@ -43,17 +43,18 @@ endif
 .NOTPARALLEL: install-mod
 smeka-install: install-mod
 install-mod: $(F_MODS)
-	$(INSTALL) -m $(_OCT_rwrr) -t $(DESTDIR)$(FMOD_DIR) $(F_MODS)
+	$(INSTALL) -m $(_OCT_rwrxrx) -d $(DESTDIR)$(FMOD_DIR)
+	$(INSTALL) -m $(_OCT_rwrr) $(F_MODS) $(DESTDIR)$(FMOD_DIR)
 
 .NOTPARALLEL: install-settings
 smeka-install: install-settings
-install-settings: settings.bash
-	$(INSTALL) -m $(_OCT_rwrr) -t $(DESTDIR)$(BIN_DIR) settings.bash
+install-settings: settings.bash smeka-install-init-dir
+	$(INSTALL) -m $(_OCT_rwrr) settings.bash $(DESTDIR)$(BIN_DIR)
 
 .NOTPARALLEL: install-header
 smeka-install: install-header
-install-header: fdict.inc
-	$(INSTALL) -m $(_OCT_rwrr) -t $(DESTDIR)$(INC_DIR) fdict.inc
+install-header: fdict.inc smeka-install-init-dir
+	$(INSTALL) -m $(_OCT_rwrr) fdict.inc $(DESTDIR)$(INC_DIR)
 
 
 # Force the deletion of both libraries
diff --git a/smeka/Makefile.install b/smeka/Makefile.install
index 997e976..2fbf4c8 100644
--- a/smeka/Makefile.install
+++ b/smeka/Makefile.install
@@ -21,16 +21,14 @@ smeka-install-lib: smeka-install-init-dir
 # Note that the x flag is common practice for libraries
 # although it may surprise first-time users.
 ifneq ($(LIBRARIES),)
-	$(INSTALL) -m $(_OCT_rwxrxrx) -t $(DESTDIR)$(LIB_DIR) $(LIBRARIES)
+	$(INSTALL) -m $(_OCT_rwxrxrx) $(LIBRARIES) $(DESTDIR)$(LIB_DIR)
 endif
 
 
 .PHONY: smeka-install-init-dir
 .NOTPARALLEL: smeka-install-init-dir
 smeka-install-init-dir:
-	-$(MKDIR) $(MKDIR_FLAG_PARENT) $(DESTDIR)$(INC_DIR)
-	-$(MKDIR) $(MKDIR_FLAG_PARENT) $(DESTDIR)$(LIB_DIR)
-	-$(MKDIR) $(MKDIR_FLAG_PARENT) $(DESTDIR)$(BIN_DIR)
+	$(INSTALL) -m $(_OCT_rwxrxrx) -d $(DESTDIR)$(LIB_DIR) $(DESTDIR)$(INC_DIR) $(DESTDIR)$(BIN_DIR)
 
 
 # Issuing uninstall will forcefully remove the installation directory

Then do make INSTALL=install?

zerothi avatar Nov 26 '20 14:11 zerothi

Sure. Thank you so much for bearing with me. I shall definitely let you know by tomorrow. Many regards, dT

Tamoghna Das Center for Soft and Living Matter Institute for Basic Sciences, Ulsan 50 UNIST-Gil, Eonyang-eup, Ulju-gun Ulsan, Republic of Korea 44919

On Thu, Nov 26, 2020 at 11:05 PM Nick Papior [email protected] wrote:

Ok, could you try and apply this patch:

diff --git a/Makefile.project b/Makefile.project index 29dfb07..0c2b8fa 100644--- a/Makefile.project+++ b/Makefile.project@@ -43,17 +43,18 @@ endif .NOTPARALLEL: install-mod smeka-install: install-mod install-mod: $(F_MODS)- $(INSTALL) -m $(_OCT_rwrr) -t $(DESTDIR)$(FMOD_DIR) $(F_MODS)+ $(INSTALL) -m $(_OCT_rwrxrx) -d $(DESTDIR)$(FMOD_DIR)+ $(INSTALL) -m $(_OCT_rwrr) $(F_MODS) $(DESTDIR)$(FMOD_DIR)

.NOTPARALLEL: install-settings smeka-install: install-settings-install-settings: settings.bash- $(INSTALL) -m $(_OCT_rwrr) -t $(DESTDIR)$(BIN_DIR) settings.bash+install-settings: settings.bash smeka-install-init-dir+ $(INSTALL) -m $(_OCT_rwrr) settings.bash $(DESTDIR)$(BIN_DIR)

.NOTPARALLEL: install-header smeka-install: install-header-install-header: fdict.inc- $(INSTALL) -m $(_OCT_rwrr) -t $(DESTDIR)$(INC_DIR) fdict.inc+install-header: fdict.inc smeka-install-init-dir+ $(INSTALL) -m $(_OCT_rwrr) fdict.inc $(DESTDIR)$(INC_DIR)

Force the deletion of both librariesdiff --git a/smeka/Makefile.install b/smeka/Makefile.install

index 997e976..2fbf4c8 100644--- a/smeka/Makefile.install+++ b/smeka/Makefile.install@@ -21,16 +21,14 @@ smeka-install-lib: smeka-install-init-dir

Note that the x flag is common practice for libraries

although it may surprise first-time users.

ifneq ($(LIBRARIES),)- $(INSTALL) -m $(_OCT_rwxrxrx) -t $(DESTDIR)$(LIB_DIR) $(LIBRARIES)+ $(INSTALL) -m $(_OCT_rwxrxrx) $(LIBRARIES) $(DESTDIR)$(LIB_DIR) endif

.PHONY: smeka-install-init-dir .NOTPARALLEL: smeka-install-init-dir smeka-install-init-dir:- -$(MKDIR) $(MKDIR_FLAG_PARENT) $(DESTDIR)$(INC_DIR)- -$(MKDIR) $(MKDIR_FLAG_PARENT) $(DESTDIR)$(LIB_DIR)- -$(MKDIR) $(MKDIR_FLAG_PARENT) $(DESTDIR)$(BIN_DIR)+ $(INSTALL) -m $(_OCT_rwxrxrx) -d $(DESTDIR)$(LIB_DIR) $(DESTDIR)$(INC_DIR) $(DESTDIR)$(BIN_DIR)

Issuing uninstall will forcefully remove the installation directory

Then do make INSTALL=install?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/zerothi/fdict/issues/24#issuecomment-734316772, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQYN5PTSK3CII4C5JRMZCALSRZOEJANCNFSM4TZEXIAQ .

kyrtle avatar Nov 26 '20 15:11 kyrtle

No worries, good to have somebody with a mac testing ;)

zerothi avatar Nov 26 '20 16:11 zerothi

@kyrtle ping, did it work? :)

zerothi avatar Dec 08 '20 15:12 zerothi

I'll close assuming it worked out!

zerothi avatar Jul 01 '21 10:07 zerothi

+install-settings: settings.bash smeka-install-init-dir
+	$(INSTALL) -m $(_OCT_rwrr) settings.bash $(DESTDIR)$(BIN_DIR)

Hello, I'm on MacOS Monterey Version: 12.4 (21F79). I'm having the issue with make PREFIX=path/to/fdict install. I get the following error: install-sh -m 755 -t /Users/sankalp/Desktop/Semester4/MPS/Beleg/collisionV1/supplementary/fdict/lib libfdict.a make: install-sh: No such file or directory make: *** [smeka-install-lib] Error 1

I'm not able to figure out where to add the patch. Could you please help?

Thanking you

Best regards, Sankalp

sankalpjena avatar Jun 13 '22 16:06 sankalpjena

+install-settings: settings.bash smeka-install-init-dir
+	$(INSTALL) -m $(_OCT_rwrr) settings.bash $(DESTDIR)$(BIN_DIR)

Hello, I'm on MacOS Monterey Version: 12.4 (21F79). I'm having the issue with make PREFIX=path/to/fdict install. I get the following error: install-sh -m 755 -t /Users/sankalp/Desktop/Semester4/MPS/Beleg/collisionV1/supplementary/fdict/lib libfdict.a make: install-sh: No such file or directory make: *** [smeka-install-lib] Error 1

I'm not able to figure out where to add the patch. Could you please help?

Thanking you

Did you try with:

make INSTALL="install -p" ...

or?

Also, try and return the value of which install and which install-sh, thanks.

zerothi avatar Jun 14 '22 08:06 zerothi

So, this is what I did. From inside the 'fdict' folder, I ran 'make' in the terminal. This is what I get: sankalp@jenambp fdict % make VPATH="." ./setup.sh --default VPATH="." ./src/variable.sh gfortran -E -P -x c -I./src -I./src -I. ./src/variable_pp.F90 | sed -f ./src/filter.sed > variable.f90 gfortran -c -o variable.o -g variable.f90 VPATH="." ./src/dictionary.sh gfortran -E -P -x c -I./src -I./src -I. ./src/dictionary_pp.F90 | sed -f ./src/filter.sed > dictionary.f90 gfortran -c -o dictionary.o -g dictionary.f90 ar rv libfdict.a variable.o dictionary.o ar: creating archive libfdict.a a - variable.o a - dictionary.o ranlib libfdict.a

Then, with your suggestion. I get the following: sankalp@jenambp fdict % make INSTALL="install -p" make: Nothing to be done for default'. (data_sc_env) sankalp@jenambp fdict % make INSTALL="install -p" ... make: *** No rule to make target ...'. Stop.

Here are the return values you asked for: (data_sc_env) sankalp@jenambp fdict % which install /usr/bin/install (data_sc_env) sankalp@jenambp fdict % which install-sh install-sh not found

sankalpjena avatar Jun 14 '22 12:06 sankalpjena

So, this is what I did. From inside the 'fdict' folder, I ran 'make' in the terminal. This is what I get: sankalp@jenambp fdict % make VPATH="." ./setup.sh --default VPATH="." ./src/variable.sh gfortran -E -P -x c -I./src -I./src -I. ./src/variable_pp.F90 | sed -f ./src/filter.sed > variable.f90 gfortran -c -o variable.o -g variable.f90 VPATH="." ./src/dictionary.sh gfortran -E -P -x c -I./src -I./src -I. ./src/dictionary_pp.F90 | sed -f ./src/filter.sed > dictionary.f90 gfortran -c -o dictionary.o -g dictionary.f90 ar rv libfdict.a variable.o dictionary.o ar: creating archive libfdict.a a - variable.o a - dictionary.o ranlib libfdict.a

Then, with your suggestion. I get the following: sankalp@jenambp fdict % make INSTALL="install -p" make: Nothing to be done for default'. (data_sc_env) sankalp@jenambp fdict % make INSTALL="install -p" ... make: *** No rule to make target ...'. Stop.

Here are the return values you asked for: (data_sc_env) sankalp@jenambp fdict % which install /usr/bin/install (data_sc_env) sankalp@jenambp fdict % which install-sh install-sh not found

My gfortran version: sankalp@jenambp fdict % gfortran --version GNU Fortran (Homebrew GCC 11.3.0_1) 11.3.0 Copyright (C) 2021 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

sankalpjena avatar Jun 14 '22 12:06 sankalpjena

Sorry, I should have been more clear. When just doing make INSTALL="..." it will only try to build fdict, not install it.

So it should be:

make INSTALL="install -p" PREFIX=... install

zerothi avatar Jun 15 '22 18:06 zerothi

I tried this and I got the error install: illegal option -- t Here's, what I did:

(data_sc_env) sankalp@jenambp fdict % make
VPATH="." ./setup.sh --default
VPATH="." ./src/variable.sh
gfortran -E -P -x c  -I./src -I./src -I. ./src/variable_pp.F90 | sed -f ./src/filter.sed > variable.f90
gfortran -c -o variable.o -g  variable.f90
VPATH="." ./src/dictionary.sh
gfortran -E -P -x c  -I./src -I./src -I. ./src/dictionary_pp.F90 | sed -f ./src/filter.sed > dictionary.f90
gfortran -c -o dictionary.o -g  dictionary.f90
ar rv libfdict.a variable.o dictionary.o
ar: creating archive libfdict.a
a - variable.o
a - dictionary.o
ranlib  libfdict.a
(data_sc_env) sankalp@jenambp fdict % make INSTALL="install -p" PREFIX=... install
mkdir -p .../include
mkdir -p .../lib
mkdir -p .../bin
install -p -m 755 -t .../lib libfdict.a
install: illegal option -- t
usage: install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
               [-o owner] file1 file2
       install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
               [-o owner] file1 ... fileN directory
       install -d [-v] [-g group] [-m mode] [-o owner] directory ...
make: *** [smeka-install-lib] Error 64

sankalpjena avatar Jun 16 '22 09:06 sankalpjena

Could you try the patch in https://github.com/zerothi/fdict/issues/24#issuecomment-734316772

I.e. copy it to a file, then do:

cd <root-dir of fdict>
patch -p 1 < file

zerothi avatar Jun 16 '22 19:06 zerothi

I think the patch worked.

 % make INSTALL="install -p" PREFIX=parent install
install -p -m 755 -d parent/lib parent/include parent/bin
install: the -d and -C options may not be specified together
install -p -m 755 libfdict.a parent/lib
install -p -m 755 -d parent/include
install: the -d and -C options may not be specified together
install -p -m 644  variable.mod  dictionary.mod parent/include
install -p -m 644 settings.bash parent/bin
install -p -m 644 fdict.inc parent/include
mkdir -p parent/lib/pkgconfig
sed "s:@PREFIX@:parent:g;\
                s:@PROJECT_NAME@:fdict:g;\
                s:@PROJECT_VERSION@:0.8.1:g;\
                s:@INC_DIR@:parent/include:g;\
                s:@LIB_DIR@:parent/lib:g;\
                s:@BIN_DIR@:parent/bin:g" \
                ./fdict.pc.in > parent/lib/pkgconfig/fdict.pc

Now, I need to add the path to the folder parent to my program's Makefile, right?

sankalpjena avatar Jun 17 '22 06:06 sankalpjena

Great! Yes, you need your own program that uses fdict to be able to locate the library and the module files, just like ordinary fortran modules/libraries.

The exact method depends on how you have created your makefile. :)

zerothi avatar Jun 17 '22 19:06 zerothi

Great! Yes, you need your own program that uses fdict to be able to locate the library and the module files, just like ordinary fortran modules/libraries.

The exact method depends on how you have created your makefile. :)

Thank you very much for the support!

sankalpjena avatar Jun 18 '22 08:06 sankalpjena

The patch has been incorporated and should work. I'll close this, thanks!

zerothi avatar Feb 21 '23 13:02 zerothi