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

problem about installing libfermat #2

Open
xwang-rs opened this issue May 12, 2017 · 8 comments
Open

problem about installing libfermat #2

xwang-rs opened this issue May 12, 2017 · 8 comments

Comments

@xwang-rs
Copy link

Hi Tueda:

Thank you for your work on this tap, which is very useful for us.
I am now trying to install libfermat for FIRE with your Homebrew Taps, however, something is wrong with my installing.

My OS is macOS Sierra 10.12.4.
After I do "brew install --HEAD tueda/loops/libfermat", I get this error:

[100%] Built target Fermat
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/fermat.dir/build.make CMakeFiles/fermat.dir/depend
make[2]: *** No rule to make target `CMakeFiles/fermat.dir/depend'.  Stop.
make[1]: *** [CMakeFiles/fermat.dir/all] Error 2
make: *** [all] Error 2

Could you please help me to figure out this issue?

Thanks,
Xing Wang

@tueda
Copy link
Owner

tueda commented May 12, 2017

Hi,

This may be hard to figure out for me, because I'm a Linuxbrew user and this formula is not tested on any Mac :-)

Could you show more detailed build logs? I think Homebrew generated some log files. Or you can run brew install --HEAD libfermat -v, where -v is for the verbose mode.

@xwang-rs
Copy link
Author

Hi,
Thanks for the reply:-)
I have run brew install --HEAD tueda/loops/libfermat -v and get some logs attached here.
libfermat.zip

@tueda
Copy link
Owner

tueda commented May 12, 2017

It turns out that the build error is due to the fact that Apple uses a case-insensitive file system by default, which is enough to confuse CMake about two targets Fermat and fermat: CMakeFiles/fermat.dir/depend and CMakeFiles/Fermat.dir/depend are unfortunately the same file on that file system.

For now, a workaround is applying a patch renaming one of the targets to libFermat, like https://gist.githubusercontent.com/tueda/df668f4e0c1d47379c41332580310d9a/raw/libfermat.rb. You can use it in Homebrew as:

brew install --HEAD -v https://gist.githubusercontent.com/tueda/df668f4e0c1d47379c41332580310d9a/raw/libfermat.rb

FYI: Test on Travis CI:

@xwang-rs
Copy link
Author

Thank you very much for this help.

  • libFermat
    Follow your advice, I just ran:
    brew install --HEAD -v https://gist.githubusercontent.com/tueda/df668f4e0c1d47379c41332580310d9a/raw/libfermat.rb
    There is still a problem, it told me:

patching file CMakeLists.txt
Hunk #1 FAILED at 21.
1 out of 1 hunk FAILED -- saving rejects to file CMakeLists.txt.rej
Error: Failure while executing: /usr/bin/patch -g 0 -f -p1

However, after this failure, I just tried to run:
brew install --HEAD -v libfermat

It worked!(But why FIRE could not find Fermat anyway? It told me I have to specify it in config file.

  • FIRE
    In fact, what I need at last is FIRE. If I just run:
    brew install -v fire
    everything is fine. However, I notice that in this way, Klink and Flink are not included, unless I run:
    brew install -v fire --with-klink --with-flink
    When building Klink and Flink, I have another problem. It seems to be with C++ standard libraries on macos. But I am not familiar with homebrew, I don't know how to fix this lib problems. Could you please give me some help?(This problem is so usual on macos...)
    The logs for these are attached.

Thank you.

fire.zip

@tueda
Copy link
Owner

tueda commented May 12, 2017

There is still a problem, it told me:

However, after this failure, I just tried to run:

My patch has been merged in the upstream.

But why FIRE could not find Fermat anyway? It told me I have to specify it in config file.

Just in case, note that FIRE doesn't use libFermat at all.

In the context of Homebrew, we need to install the files into the specified directory. (The build directory is deleted after the installation.) FIRE doesn't offer such an installation, so the formula just copies the files. But I didn't include Fermat in the list of files to be copied because

  1. the licence of Fermat is unclear to me. So I don't like to touch it,
  2. people may want to use the latest version of Fermat, or some specific version.

Instead, when fer64 is found in $PATH during a build, then the formula overwrites the source code for the default path to Fermat.

When building Klink and Flink, I have another problem. It seems to be with C++ standard libraries on macos.

About the undefined symbols linked from libMLi4.a, this would be very tricky (even on Linux). You need to have a compiler configuration that is compatible to one used in building libMLi4.a by Wolfram Research. One thing you could try is: http://community.wolfram.com/groups/-/m/t/610879. In fire.rb (you can edit it by brew edit fire), there are two lines that patch to Makefiles in FIRE for FLink and KLink (line 150 and line 224):

+LDFLAGS += -L$(CADDSDIR) -framework Foundation -mmacosx-version-min=10.5
+LDFLAGS += -L${CADDSDIR} -framework Foundation -mmacosx-version-min=10.5

You could try to append -stdlib=libstdc++ or -lc++ or the both, to these lines.

For this I can't test, because I don't have any macOS configuration with Mathematica.

@xwang-rs
Copy link
Author

Hi Takahiro,
Thank you very much for giving me so much help so far.
I will try your suggestion on my laptop and let you know whatever I get.
Bests.

@raydsameshima
Copy link
Contributor

raydsameshima commented Mar 14, 2018

Dear Ueda-san,
Thanks a lot on this useful tap.
When I try to instal kira, it gets stacked.
Even though I've put both GINAC_CFLAGS
and GINAC_LIBS.

Here I put the last few error message.
Could you provide what to do for this error?
thanks in advance,
ray

Last 15 lines from /Users/rds/Library/Logs/Homebrew/kira/01.configure:
checking dependency style of clang... (cached) none
checking for main in -ldl... yes
checking for pkg-config... no
checking for GINAC... no
configure: error: in `/private/tmp/kira-20180314-18781-9z42ga/kira-1.0':
configure: error: The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.

Alternatively, you may set the environment variables GINAC_CFLAGS
and GINAC_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

To get pkg-config, see http://pkg-config.freedesktop.org/.
See `config.log' for more details

If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
https://github.com/tueda/homebrew-loops/issues

rds:kira-1.0 rds$ echo $GINAC_CFLAGS
-I/usr/local/Cellar/
rds:kira-1.0 rds$ echo $GINAC_LIBS
-L/usr/local/Cellar/ginac/1.7.4/lib -lginac

@tueda
Copy link
Owner

tueda commented Mar 15, 2018

@raydsameshima Thank you for your report.
I think this can happen if you don't have pkg-config, or pkg-config is unavailable (might be disabled) during a build of kira. I have updated the formula. At least it works on my laptop (Ubuntu on Windows), where I found the same problem. Could you retry with the updated formula?

By the way, in a next bug report, making a new issue instead of adding comments would be more helpful unless it's closely related. (But for now, OK.)

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

3 participants