WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: fortran compiler for scipy  (Read 3538 times)

Offline seandepagnier

  • Newbie
  • *
  • Posts: 14
fortran compiler for scipy
« on: March 16, 2020, 11:06:39 AM »
I noticed gcc has fortran (and many other languages) enabled but I cannot find "gfortran" and scipy fails to find fortran compiler while building.

What is the best way to get fortran (or scipy) on pi core?

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14849
Re: fortran compiler for scipy
« Reply #1 on: March 16, 2020, 01:00:51 PM »
If a gfortran extension doesn’t exist, you’ll need to compile it with gcc.

Offline seandepagnier

  • Newbie
  • *
  • Posts: 14
Re: fortran compiler for scipy
« Reply #2 on: March 17, 2020, 11:35:28 AM »
Could you point me to the build scripts for gcc?  I'm on picore 9, I can only find scripts for picore 4.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14849
Re: fortran compiler for scipy
« Reply #3 on: March 17, 2020, 12:35:15 PM »
If you enter "gcc -v", it should tell you how it was configured - then it's just a matter of adding fortran to --enable-languages=

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11694
Re: fortran compiler for scipy
« Reply #4 on: March 17, 2020, 12:50:09 PM »

Offline seandepagnier

  • Newbie
  • *
  • Posts: 14
Re: fortran compiler for scipy
« Reply #5 on: March 17, 2020, 12:56:28 PM »
I will build gcc from source now, but I am interested to see the build script for gcc.tcz.

@rich
I looked at the x86 version but it does not create a tcz.   What am I missing?

gcc -v shows:   "--enable-languages=c,c++,fortran,go"  for pi-core but obviously no fortran.  Was it split into a separate package?

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11694
Re: fortran compiler for scipy
« Reply #6 on: March 17, 2020, 01:11:40 PM »
Hi seandepagnier
... I looked at the x86 version but it does not create a tcz.   What am I missing? ...
Creating a  .tcz  involves packaging the created files using  mksquashfs.  The first thing you should read is:
http://wiki.tinycorelinux.net/wiki:creating_extensions

Offline seandepagnier

  • Newbie
  • *
  • Posts: 14
Re: fortran compiler for scipy
« Reply #7 on: March 18, 2020, 09:13:48 AM »
Thank you, I know how squashfs is used, but I would like to see the script used to build gcc.tcz so it can be easily reproduced and I can see how fortran was carved out so I could make a package for just the missing fortran part.


I did compile gcc with gfortran but "make install" to ram runs out of disk space. 

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11694
Re: fortran compiler for scipy
« Reply #8 on: March 18, 2020, 09:26:26 AM »
Hi seandepagnier
... I did compile gcc with gfortran but "make install" to ram runs out of disk space.
Then try pointing it to some persistent storage.Maybe something like:
Code: [Select]
mkdir /mnt/sda1/package
make DESTDIR=/mnt/sda1/package install

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14849
Re: fortran compiler for scipy
« Reply #9 on: March 18, 2020, 10:23:03 AM »

Offline seandepagnier

  • Newbie
  • *
  • Posts: 14
Re: fortran compiler for scipy
« Reply #10 on: March 19, 2020, 06:08:29 PM »
Hi seandepagnier
... I did compile gcc with gfortran but "make install" to ram runs out of disk space.
Then try pointing it to some persistent storage.Maybe something like:
Code: [Select]
mkdir /mnt/sda1/package
make DESTDIR=/mnt/sda1/package install
I did this and unfortunately it lead to more errors because the c++ library is not found with the new compiler.   I think more hints to include directories are needed somehow.  Unfortunately scipy uses both c++ and fortran.

After changing PATH back and forth after each failure after a few times I got scipy to build but on loading it fails with unresolved externals.

I am trying again with a different gcc version and hopefully it will work.    It's difficult to build on tinycore because of the limited ram...   is there a way to have a larger ramdisk by adding more swap?   I already need to add a lot of swap to make this build but it's not giving me more space in /

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11694
Re: fortran compiler for scipy
« Reply #11 on: March 19, 2020, 08:17:44 PM »
Hi seandepagnier
...   It's difficult to build on tinycore because of the limited ram...   is there a way to have a larger ramdisk by adding more swap?   I already need to add a lot of swap to make this build but it's not giving me more space in /
I should have also suggested you download and build the source in persistent storage. That should leave a lot more RAM available
for the build.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14849
Re: fortran compiler for scipy
« Reply #12 on: March 20, 2020, 01:43:08 AM »
I am trying again with a different gcc version and hopefully it will work.

I think that, in order to avoid strange problems, you would need to compile gfortran with the same version of gcc in use with piCore.