Question about running Polymer on Linux machine

Post Reply
dmantsis
Posts: 8
Joined: Mon Dec 13, 2021 9:53 am
company / institution: Centre for Research and Technology Hellas
Location: Thessaloniki

Question about running Polymer on Linux machine

Post by dmantsis »

Hi
I am trying to run Polymer on a Linux machine, but I have encountered a problem. So far I have installed the dependencies and created the Polymer environment using the following (without any error messages)

conda create –n polymer –c conda-forge mamba
conda activate polymer
mamba env update –f environment.yml

after this I have downloaded auxiliary data, I have created the directory for the ancillary data to be dowloaded, and I have converted the files to C and compiled the code with

make auxdata_all
make
make ancillary

So far, no problems. However, as soon as I try to run the first block of my Jupiter notebook code (using the polymer environment), the code crashes on this line

from polymer.main import run_atm_corr, Level1, Level2

with an error (bellow). Is there someone that could help?
Thank you for your time

---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
/tmp/ipykernel_1364341/3681058688.py in <module>
4
5 import sys, os, time
----> 6 from polymer.main import run_atm_corr, Level1, Level2
7 from polymer.ancillary_era5 import Ancillary_ERA5
8 from polymer.level1_msi import Level1_MSI

~/AtmCorr/Polymer/polymer-v4.14/polymer/main.py in <module>
16 from polymer.level2 import Level2
17 from polymer.bodhaine import rod
---> 18 from polymer.polymer_main import PolymerMinimizer
19 from polymer.water import ParkRuddick, MorelMaritorena
20 from warnings import warn

ModuleNotFoundError: No module named 'polymer.polymer_main'
Last edited by dmantsis on Wed Jan 12, 2022 10:03 am, edited 1 time in total.
Ehsan Mehdipour
Posts: 5
Joined: Fri Oct 08, 2021 9:37 am
company / institution: Alfred Wegener Institute of Polar and Marine Science
Location: Bremerhaven

Re: Problem running Polymer on Linux machine

Post by Ehsan Mehdipour »

HI,

I had the same problem but there are three important point to consider:
1. you should compile all the code inside the environment (I think you did)
2. you should have cython and gcc installed
3. try to run: "make all" in polymer folder.

Best,
Ehsan
User avatar
fsteinmetz
Site Admin
Posts: 306
Joined: Fri Sep 07, 2018 1:34 pm
company / institution: Hygeos
Location: Lille, France
Contact:

Re: Problem running Polymer on Linux machine

Post by fsteinmetz »

Hi,
Please make sure that your current directory is the polymer root folder ~/AtmCorr/Polymer/polymer-v4.14/
In jupyter notebook, you can use the commands "pwd" and "cd ~/AtmCorr/Polymer/polymer-v4.14/".
Then you should be able to run the import commands.
Cheers,
François
dmantsis
Posts: 8
Joined: Mon Dec 13, 2021 9:53 am
company / institution: Centre for Research and Technology Hellas
Location: Thessaloniki

Re: Problem running Polymer on Linux machine

Post by dmantsis »

Hi and thank you for your help
First of all, dear Stefan I am running my Jupiter Notebook using the Polymer environment I have created and I am running it from

/home/dmantsis/AtmCorr/Polymer/polymer-v4.14

which is the current working directory.

Additionally, dear Ehsan the problem persists even when I run make all in the Polymer directory. Also, cython is included in the Polymer anaconda environment. Regarding bcc, there are some that are included and other that are not. I am listing the ones that are not included in the anaconda environment, just in case you can point the one that is missing:

gcc-dbg_linux-64
gcc_bootstrap_lin... (name does not appear in full)
gcc_impl_linux-64
gcc_linux-64
libgcc
libgcc-amzn2-aarch64
libgcc-devel_linux-64
libgcj-cos6-x86_64
r-rgcca

Is there anything else that I could be missing?
Thank you for your time
dmantsis
Posts: 8
Joined: Mon Dec 13, 2021 9:53 am
company / institution: Centre for Research and Technology Hellas
Location: Thessaloniki

Re: Problem running Polymer on Linux machine

Post by dmantsis »

Ehsan Mehdipour wrote:
Thu Jan 06, 2022 1:57 pm
HI,

I had the same problem but there are three important point to consider:
1. you should compile all the code inside the environment (I think you did)
2. you should have cython and gcc installed
3. try to run: "make all" in polymer folder.

Best,
Ehsan
Hi Eshan
Regarding the cython and gcc, do these have to be installed in my anaconda environment or the linux machine? Also, I was wondering if you could look at my other reply and let me know if you see something that I could be missing?
Thank you
Ehsan Mehdipour
Posts: 5
Joined: Fri Oct 08, 2021 9:37 am
company / institution: Alfred Wegener Institute of Polar and Marine Science
Location: Bremerhaven

Re: Problem running Polymer on Linux machine

Post by Ehsan Mehdipour »

dmantsis wrote:
Mon Jan 10, 2022 3:01 pm
Ehsan Mehdipour wrote:
Thu Jan 06, 2022 1:57 pm
HI,

I had the same problem but there are three important point to consider:
1. you should compile all the code inside the environment (I think you did)
2. you should have cython and gcc installed
3. try to run: "make all" in polymer folder.

Best,
Ehsan
Hi Eshan
Regarding the cython and gcc, do these have to be installed in my anaconda environment or the linux machine? Also, I was wondering if you could look at my other reply and let me know if you see something that I could be missing?
Thank you
Hi,

I am not sure if the problem is related to gcc.
However, the gcc that I am using in my conda env:
libgcc-ng 11.2.0 h1d223b6_11 conda-forge

and the default gcc module installed in the HPC:
gcc --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28)

Cheers,
Ehsan
dmantsis
Posts: 8
Joined: Mon Dec 13, 2021 9:53 am
company / institution: Centre for Research and Technology Hellas
Location: Thessaloniki

Re: Problem running Polymer on Linux machine

Post by dmantsis »

Hi
The problem has been solved. I went through Eshan's suggestions and I realized that the make all command was done in the base environment and not the polymer environment. So at this point the import commands are working. Thank you for your help
Post Reply