./configure
make
தங்கள் கணினியில் gfortran
நிறுவப்பட்டு இருக்க வேண்டும். நிறுவிய பின் மேலே உள்ள கமாண்டுகளை முயற்சி செய்து பார்க்கவும்.
./configure
make
தங்கள் கணினியில் gfortran
நிறுவப்பட்டு இருக்க வேண்டும். நிறுவிய பின் மேலே உள்ள கமாண்டுகளை முயற்சி செய்து பார்க்கவும்.
thanks for answering i have gfortran, i did the same instructions as you said and always same result (undefined reference)
mokthar@mokthar-VirtualBox:~/fac-master$ gfortran --version
GNU Fortran (Ubuntu 11.3.0-1ubuntu1~22.04.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.
git clone
செய்யப்பட்ட fac
டைரக்டரியில் இருந்து
(git clean -ffdx; ./configure; make) 2>&1 | curl --data-binary @- https://paste.rs
இந்த கமாண்டை இயக்கி இருதியில் வரும் இணைய இணைப்பை இங்கே பகிரவும்.
sorry i didn’t really understand buti’m gonna show you what i did (ididn’t get a result)
mokthar@mokthar-VirtualBox:~/fac-master$ git clean
fatal: ni ceci ni aucun de ses répertoires parents n'est un dépôt git : .git
````mokthar@mokthar-VirtualBox:~/fac-master$ git clean -ffdx
fatal: ni ceci ni aucun de ses répertoires parents n'est un dépôt git : .git`
```mokthar@mokthar-VirtualBox:~/fac-master$ sudo apt install curl
Lecture des listes de paquets... Fait
Construction de l'arbre des dépendances... Fait
Lecture des informations d'état... Fait
curl est déjà la version la plus récente (7.81.0-1ubuntu1.10).
0 mis à jour, 0 nouvellement installés, 0 à enlever et 27 non mis à jour.
mokthar@mokthar-VirtualBox:~/fac-master$ 2>&1 | curl --data-binary @- https://paste.rs
type or paste code here
You have to run this whole commandline, not one by one, copy this whole commandline and paste it in terminal under fac-master
directory.
(git clean -ffdx; ./configure; make) 2>&1 | curl --data-binary @- https://paste.rs
It will return one link, share that link here.
thanks for your help i really appreciate it, that’s the link[Preformatted text](https://paste.rs/22eThmokthar@mokthar-VirtualBox:~/fac-master$)
From this logs, I can see that the code was properly compiled. Whatever you expect after compiling this project should be available to you.
but i don’t know why it doesn’t show the printf and i don’t know the reason for the undefined reference and the most important i don’t know how to solve it i need help please
but i don’t know why it doesn’t show the printf
how do you reproduce this problem? what command are you running? you mean the issue happens when you run this command?
fac-master/faclib$ gcc -o excitation excitation.c
If yes, then why you try to compile a single source file excitation.c
manually? this file will be compiled with proper compiler flags when you run
./configure; make
This is how you compile the whole project, you should not compile individual .c
files one by one.
i understand but when i do that (fac) farah@farah:~/Sources/fac$ sfac demo/excitation/fe17_excitation.sf
after doing make all and make clean it doesn’t show the printf (I’m working on my pc and with a virtual machine same issue)
fac
repository will be newly cloned to your system inside fac-fresh
directorygit clone https://github.com/flexible-atomic-code/fac fac-fresh
cd fac-fresh
fac.patch
file to fac-fresh
directorycurl -O 'https://gist.githubusercontent.com/mohan43u/4ffcb5968be890c186018620b799d522/raw/093f711b02ec0dcabe5dce98adaf192fde0853d4/fac.patch'
git apply fac.patch
sudo apt install packaging-dev python2-dev gfortran
python2
is your default python
in your systempython --version
python
, then make python2
as your default pythonsudo ln -s python2 /usr/bin/python
Warning: You may need to remove or change the default python to the previous state after compiling fac
fac
debuild -b -uc -us -tc
fac
sudo dpkg -i ../fac_*.deb
make -C demo
You should see all the demos run successfully without any issues. Make sure to rollback your default python settings to previous state. I dont know for what purpose you are trying to use this fac
, but you should not depend on this project, it is not maintained anymore, it is still depending on python2
which is not a good sign.
thank you, i did thispatch -p1 < fac.patch
instead of git apply fac.patch
cause it didn’t work i had an output files but not using the excitation.c cause now i did a little change i added an equation in the excitation.c file with that
printf("enter the value of K : "); scanf("%d",&K);
but i didn’t get that on terminal to enter the value so the code can compile it and it gives me an output file with the new value of K
fac.patch
is not for regular patch
command, only git apply
understand this patch file.
Try to follow the instructions I gave here and confirm that fac
was built and installed correctly on your system. Once you confirm the demos
are successfully worked, then you can do whatever experiments you want on excitation.c
Just modifying something in excitation.c
and expecting it to work to your need without properly building and installing fac
doesn’t make any sense.
sorry, i did exactly what you told me to do except for the git applu cause i got that
mokthar@mokthar-VirtualBox:~/fac-master/fac-fresh$ git apply fac.patch error: patch corrompu à la ligne 160
but i think the demos works cause i got that a the final `mokthar@mokthar-VirtualBox:~/fac-master/fac-fresh$ make -C demo
make : on entre dans le répertoire « /home/mokthar/fac-master/fac-fresh/demo »
make[1] : on entre dans le répertoire « /home/mokthar/fac-master/fac-fresh/demo/structure »
make[1] : on quitte le répertoire « /home/mokthar/fac-master/fac-fresh/demo/structure »
make[1] : on entre dans le répertoire « /home/mokthar/fac-master/fac-fresh/demo/excitation »
make[1] : on quitte le répertoire « /home/mokthar/fac-master/fac-fresh/demo/excitation »
make[1] : on entre dans le répertoire « /home/mokthar/fac-master/fac-fresh/demo/pirr »
make[1] : on quitte le répertoire « /home/mokthar/fac-master/fac-fresh/demo/pirr »
make[1] : on entre dans le répertoire « /home/mokthar/fac-master/fac-fresh/demo/aidr »
make[1] : on quitte le répertoire « /home/mokthar/fac-master/fac-fresh/demo/aidr »
make[1] : on entre dans le répertoire « /home/mokthar/fac-master/fac-fresh/demo/ionization »
make[1] : on quitte le répertoire « /home/mokthar/fac-master/fac-fresh/demo/ionization »
make[1] : on entre dans le répertoire « /home/mokthar/fac-master/fac-fresh/demo/polariz »
0 0.0000E+00 1.00000000E+00 0.00000000E+00 5.8300E-04
1 0.0000E+00 1.00000000E+00 0.00000000E+00 9.0000E-05
make[1] : on quitte le répertoire « /home/mokthar/fac-master/fac-fresh/demo/polariz »
make[1] : on entre dans le répertoire « /home/mokthar/fac-master/fac-fresh/demo/NeL »
TR: g2 → g2
TR: g2 → g3
TR: g2 → g4
TR: g2 → g5
TR: g3 → g3
TR: g3 → g4
TR: g3 → g5
TR: g4 → g4
TR: g4 → g5
TR: g5 → g5
CE: g2 → g2
CE: g2 → g3
CE: g2 → g4
CE: g2 → g5
Population Iteration:
0 1.0000E+00 2.4700E-04 2.4700E-04 2.2420E+07
1 2.5937E-03 8.8000E-05 3.3500E-04 2.2420E+07
2 1.7916E-04 2.3000E-05 3.5800E-04 2.2420E+07
3 8.9573E-05 1.4000E-05 3.7200E-04 2.2420E+07
4 4.4784E-05 1.4000E-05 3.8600E-04 2.2420E+07
5 2.2390E-05 1.4000E-05 4.0000E-04 2.2420E+07
6 1.1195E-05 1.4000E-05 4.1400E-04 2.2420E+07
7 5.5969E-06 1.4000E-05 4.2800E-04 2.2420E+07
8 2.7983E-06 1.5000E-05 4.4300E-04 2.2420E+07
9 1.3990E-06 1.4000E-05 4.5700E-04 2.2420E+07
10 6.9948E-07 1.3000E-05 4.7000E-04 2.2420E+07
make[1] : on quitte le répertoire « /home/mokthar/fac-master/fac-fresh/demo/NeL »
make[1] : on entre dans le répertoire « /home/mokthar/fac-master/fac-fresh/demo/tests »
running crm_OI.py
Population Iteration:
0 1.0000E+00 8.7000E-05 8.7000E-05 2.2425E+07
1 0.0000E+00 6.0000E-05 1.4700E-04 2.2425E+07
make[1] : on quitte le répertoire « /home/mokthar/fac-master/fac-fresh/demo/tests »
make : on quitte le répertoire « /home/mokthar/fac-master/fac-fresh/demo »`
and some output files, can you please explain to me how to link the fe17_excitation.sf with the excitation.c ?
functions declared in faclib/excitation.h
and defined in faclib/excitation.c
are part of libfac.a
library which gets embedded into sfac
executable as well as pfac
python library during compilation.
You can use those functions defined in faclib/excitation.c
through specific instructions for sfac
executable via a file, one such example file is demo/excitations/fe17_excitation.sf
, If you want to see the results of the instructions in demo/excitations/fe17_excitation.sf
, then run
sfac demo/excitation/fe17_excitation.sf
This will generate some output files according to the instructions given in the .sf
file.
you can also use those functions defined in faclib/excitation.c
through python by importing pfac
python module. once such example is demo/excitation/fe17_excitation.py
, to see the results of the instructions in demo/excitation/fe17_excitation.py
, then run
python2 demo/excitation/fe17_excitation.py
If you do changes in faclib/excitation.c
and want to see the results, then you have to rebuild sfac
executable and pfac
python library, simplest way is to rebuild the whole project, install the new .deb
file to your system and then run these two commands above.
thank you for your answers, I’ve tried to do what you told a rebuild fac i did that debuild -b -uc -us -tc
sudo dpkg -i ../fac_*.deb
make -C demo
sfac demo/excitation/fe17_excitation.sf
python2 demo/excitation/fe17_excitation.py
i’ve got output files
printf("enter the value of K : ");
is it an issue ??It means the changed lines in excitation.c
was not hit by the instructions in fe17_excitation.sf
or fe17_excitation.py
You need to understand the complete flow for each instructions in fe17_excitation.sf
or fe17_excitation.py
, how every instruction is executed in those input files and how functions inside excitation.c
gets triggered by those instruction in the input files.
for starting, under gdb, run sfac
with input file demo/excitation/fe17_excitation.sf
, try to put a break point in the line which you changed in execution.c
and see if that line gets triggered or not. To know more about gdb, read this,
sorry i’ve tried to work with gdb but i couldn’t i didn’t really understand so can you please help me by telling me what to do please
Without understand gdb
, you cannot debug a C
program. I wish you will get the help needed from the internet.
At least in this thread, we solved the compilation issues in fac
. So, I’m marking this thread as solved.
thank you so much you helped me a lot for the gdb i will try to understand it