انجمن‌های فارسی اوبونتو

لطفاً به انجمن‌ها وارد شده و یا جهت ورود ثبت‌نام نمائید

لطفاً جهت ورود نام کاربری و رمز عبورتان را وارد نمائید


ارائه ۲۴٫۱۰ اوبونتو منتشر شد 🎉

نویسنده موضوع: تغییر کامپایلر دیفالت mpif90(حل شد)  (دفعات بازدید: 6545 بار)

0 کاربر و 7 مهمان درحال مشاهده موضوع.

آفلاین noyan1367

  • Jr. Member
  • *
  • ارسال: 69
  • جنسیت : پسر
پاسخ : تغییر کامپایلر دیفالت mpif90
« پاسخ #30 : 13 تیر 1397، 03:42 ب‌ظ »
اونارو پاک کردم.
اینم خروجی دستور:
mohammad67@ubuntu:~$ mpif90 -fc=ifort -show

Command 'mpif90' not found, but can be installed with:

sudo apt install libmpich-dev 
sudo apt install libopenmpi-dev
خيال غرق شدن در نگاه ژرف تو بود
كه دل زديم به درياي بي خيالي ها
قيصرامين پور🌷

آفلاین noyan1367

  • Jr. Member
  • *
  • ارسال: 69
  • جنسیت : پسر
پاسخ : تغییر کامپایلر دیفالت mpif90
« پاسخ #31 : 13 تیر 1397، 03:44 ب‌ظ »
نقل‌قول
به دلیل وجود خط زیر توی فایل ~/.bashrc تون :

کد: [انتخاب]

 export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/mohammad67/Desktop/SeisUnix-master/bin:/home/mohammad67/Desktop/SeisUnix-master/bin


باینری های موجود در /usr/bin توی اولویت قرار می گیرن و بش اول اونا رو مد نظر قرار می ده و از اون جایی که openmpi و mpich هنوز کامل پاک نشدن بش اونا رو به mpi اینتل ترجیح می ده
اینو یه نرم افزار به اسم seismicunix نصب کردم خودش اضافه کرده.
خيال غرق شدن در نگاه ژرف تو بود
كه دل زديم به درياي بي خيالي ها
قيصرامين پور🌷

آفلاین علی رزم دیده

  • عضو کاربران ایرانی اوبونتو
  • *
  • ارسال: 1244
  • جنسیت : پسر
  • ali76 سابق
پاسخ : تغییر کامپایلر دیفالت mpif90
« پاسخ #32 : 13 تیر 1397، 03:53 ب‌ظ »
احتمال داره نسخه ی 13 parallel studio که شما استفاده می کنین mpi اینتل رو نداشته باشه (چون من هم به این نسخه دسترسی ندارم نمی تونم این قضیه رو چک کنم)

ولی اشکال نداره شما می تونین از mpich استفاده کنین که از ifort هم پشتیبانی می کنه :
sudo apt install mpich
حالا دیگه خروجی این دستور نباید gfortran باشه :
mpif90 -fc=ifort -show
اگه این دستور خطا داد یا کار نکرد این دستور رو چک کنین :
mpif90.mpich -fc=ifort -show

آفلاین noyan1367

  • Jr. Member
  • *
  • ارسال: 69
  • جنسیت : پسر
پاسخ : تغییر کامپایلر دیفالت mpif90(حل شد)
« پاسخ #33 : 13 تیر 1397، 04:36 ب‌ظ »
علی جان واقعا مچکرم.
درست شد با اون دستور.
mohammad67@ubuntu:~$ mpif90 -fc=ifort -show
ifort -Wl,-Bsymbolic-functions -Wl,-z,relro -I/usr/include/mpich -I/usr/include/mpich -L/usr/lib/x86_64-linux-gnu -lmpichfort -lmpich
ولی وقتی خالی میزنی یعنی ست نمیکنی کامپایلر رو باز gfortranنشون میده.
mohammad67@ubuntu:~$ mpif90 -show
gfortran -Wl,-Bsymbolic-functions -Wl,-z,relro -I/usr/include/mpich -I/usr/include/mpich -L/usr/lib/x86_64-linux-gnu -lmpichfort -lmpich
الان اون کد مورد نظرمو کامپایل کردم باز از  gfortran استفاده کرد. ](*,)
« آخرین ویرایش: 13 تیر 1397، 04:40 ب‌ظ توسط noyan1367 »
خيال غرق شدن در نگاه ژرف تو بود
كه دل زديم به درياي بي خيالي ها
قيصرامين پور🌷

آفلاین علی رزم دیده

  • عضو کاربران ایرانی اوبونتو
  • *
  • ارسال: 1244
  • جنسیت : پسر
  • ali76 سابق
پاسخ : تغییر کامپایلر دیفالت mpif90
« پاسخ #34 : 13 تیر 1397، 04:54 ب‌ظ »
خواهش می کنم دوست من.

در مورد ست کردن کامپایلر پیش فرض اول شما باید کامپایلر دلخواهتون رو export کنین :
export MPICH_FC=ifort
بعدش امتحان کنین :
mpif90 -show
در ضمن می تونین اون خط export رو توی فایل .bashrc تون قرار بدین تا همواره ifort استفاده بشه.

آفلاین noyan1367

  • Jr. Member
  • *
  • ارسال: 69
  • جنسیت : پسر
پاسخ : تغییر کامپایلر دیفالت mpif90
« پاسخ #35 : 13 تیر 1397، 06:08 ب‌ظ »
بازم تشکر میکنم ازت علی جان. :)
خيال غرق شدن در نگاه ژرف تو بود
كه دل زديم به درياي بي خيالي ها
قيصرامين پور🌷

آفلاین علی رزم دیده

  • عضو کاربران ایرانی اوبونتو
  • *
  • ارسال: 1244
  • جنسیت : پسر
  • ali76 سابق
پاسخ : تغییر کامپایلر دیفالت mpif90
« پاسخ #36 : 13 تیر 1397، 06:11 ب‌ظ »
خواهش می کنم
مشکلتون حل شد ؟

آفلاین noyan1367

  • Jr. Member
  • *
  • ارسال: 69
  • جنسیت : پسر
پاسخ : تغییر کامپایلر دیفالت mpif90
« پاسخ #37 : 13 تیر 1397، 07:06 ب‌ظ »
اون مرحله رو رد کرد. بدبختانه تو آخرین مرحله کامپایل باز به ویژگی های MPI گیر داده و اجرا نشد.
mpif90 -O2 -fpp  -m64      -c -o Occam.o Occam.f90
Occam.f90(57): error #7013: This module file was not generated by any release of this compiler.   [MPI]
    use mpi
--------^
Occam.f90(1399): error #6404: This name does not have a type, and must have an explicit type.   [MPI_INTEGER]
    call mpi_bcast(sizeM, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
-----------------------------^
Occam.f90(1399): error #6404: This name does not have a type, and must have an explicit type.   [MPI_COMM_WORLD]
    call mpi_bcast(sizeM, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
---------------------------------------------^
compilation aborted for Occam.f90 (code 1)
Makefile:369: recipe for target 'Occam.o' failed
make: *** [Occam.o] Error 1
علی جان میشه سورس کد رو بگیری رو  parallel studio 18 که داری یه امتحان کنی ببینی کامپایل میشه؟
سورس کد رو از اینجا میتونی دانلود کنی:
http://mare2dem.ucsd.edu/?page_id=108
دستور کامپایلش خیلی راحته:
make CLUSTER=tscc
خيال غرق شدن در نگاه ژرف تو بود
كه دل زديم به درياي بي خيالي ها
قيصرامين پور🌷

آفلاین علی رزم دیده

  • عضو کاربران ایرانی اوبونتو
  • *
  • ارسال: 1244
  • جنسیت : پسر
  • ali76 سابق
پاسخ : تغییر کامپایلر دیفالت mpif90
« پاسخ #38 : 13 تیر 1397، 10:24 ب‌ظ »
با دستوری که دادین ، برای منم تو همون مرحله گیر کردش :
Occam.f90(57): error #7013: This module file was not generated by any release of this compiler.   [MPI]
    use mpi
--------^
Occam.f90(1399): error #6404: This name does not have a type, and must have an explicit type.   [MPI_INTEGER]
    call mpi_bcast(sizeM, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
-----------------------------^
Occam.f90(1399): error #6404: This name does not have a type, and must have an explicit type.   [MPI_COMM_WORLD]
    call mpi_bcast(sizeM, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
---------------------------------------------^
compilation aborted for Occam.f90 (code 1)
make: *** [Makefile:369: Occam.o] Error 1

آفلاین noyan1367

  • Jr. Member
  • *
  • ارسال: 69
  • جنسیت : پسر
پاسخ : تغییر کامپایلر دیفالت mpif90
« پاسخ #39 : 13 تیر 1397، 11:36 ب‌ظ »
فک کنم باید با openmpi کامپایل بشه. :(
خيال غرق شدن در نگاه ژرف تو بود
كه دل زديم به درياي بي خيالي ها
قيصرامين پور🌷

آفلاین علی رزم دیده

  • عضو کاربران ایرانی اوبونتو
  • *
  • ارسال: 1244
  • جنسیت : پسر
  • ali76 سابق
پاسخ : تغییر کامپایلر دیفالت mpif90
« پاسخ #40 : 14 تیر 1397، 01:40 ق‌ظ »
بدون مشکل تونستم کامپایلش کنم :
make[1]: Leaving directory '/home/asus/Source/libraries/SuiteSparse/UMFPACK'
mpif90 -O2 -fpp -fc=ifort   kdtree2.o fem2D_utilities.o  binaryTree.o  call_triangle.o sort.o c_fortran_zgssv.o  superlu_zsolver.o umf4_f77zwrapper.o umfpack_zsolver.o string_helpers.o triangle.o mt1D.o EMconstants.o em2dkx.o   Occam.o c_fortran_triangle.o FilterModules.o mare2dem_common.o  spline_kx_module.o mare2dem_worker.o mare2dem_io.o mare2dem_mpi.o   EM2D.o RunMARE2DEM.o  ./libraries/SuperLU_4.0/libsuperlu_4.0.a ./libraries/SuiteSparse/UMFPACK/Lib/libumfpack.a ./libraries/SuiteSparse/AMD/Lib/libamd.a  ./libraries/SuiteSparse/CHOLMOD/Lib/libcholmod.a  ./libraries/SuiteSparse/COLAMD/Lib/libcolamd.a ./libraries/SuiteSparse/CAMD/Lib/libcamd.a  ./libraries/SuiteSparse/CCOLAMD/Lib/libccolamd.a    ./libraries/metis-4.0/libmetis.a ./libraries/scalapack-2.0.2/libscalapack.a \
        -L/opt/intel/compilers_and_libraries_2018.0.128/linux/mkl/lib/intel64   -I/opt/intel/compilers_and_libraries_2018.0.128/linux/mkl/include   -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread   -o MARE2DEM

اینم خروجی :
mpirun -np 2 ./MARE2DEM
که نیشون می ده به درستی کار می کنه (البته MARE2DEM باید با یک آرگومان ران بشه ولی من همین طوری فقط اجراش کردم تا ببینم اوضاع چطوره) :
============================= MARE2DEM ===================================
 
  MARE2DEM: Modeling with Adaptively Refined Elements for 2.5D EM
 
  Version: 10 March 2014
 
  A parallel goal-oriented adaptive finite element forward and inverse
  modeling code for electromagnetic fields from electric dipoles, magnetic
  dipoles and magnetotelluric sources in triaxially anisotropic conducting
  media. Iterative adaptive mesh refinement is accomplished using the
  goal-oriented error estimation method described in Key and Ovall (2011).
  Inversion is accomplished by the Occam method (Constable et al., 1987). 
 
  This work was supported by:
 
  The Seafloor Electromagnetic Methods Consortium   
  at Scripps Institution of Oceanography 
 
  See this URL for a list of current SEMC funding sponsors:
 
  http://marineemlab.ucsd.edu/semc.html
 
  Copyright (C) 2008-2014
  Kerry Key
  Scripps Institution of Oceanography
  University of California, San Diego
 
  This file is part of MARE2DEM.
 
  MARE2DEM is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.
 
  MARE2DEM is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.
 
  You should have received a copy of the GNU General Public License
  along with MARE2DEM.  If not, see <http://www.gnu.org/licenses/>.
 
 ==========================================================================
 
 MARE2DEM is using one manager node and 1 compute nodes
 
 
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 MARE2DEM error, no command line arguments given!
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
 
 Usage:  MARE2DEM <-F, -FJ or -FF> <resistivity file> <output root name>
 
 MARE2DEM has three optional flags (*normal inversion uses no flags):
 
       -F    Computes the forward response of the input model only.
             The forward response is output to <resistivity file>.resp
 
       -FJ   Computes the forward response and the model Jacobian matrix.
             The forward response is output to <resistivity file>.resp
             The Jacaobian matrix is output to <resistivity file>.jacobian
 
       -FF   Computes the forward response of the input model and
             outputs all 3 components of E and H for all combinations of
             transmitters, receivers and frequencies in the data file. 
             Ignores the data array section of the data file. The fields 
             The fields are output to <resistivity file>.fieldsMT and
             and <resistivity file>.fieldsCSEM
 
 MARE2DEM has one required parameter:
 
       <resistivity file root> - This is the name of the input resistivity 
       file. By convention, this file should have the extension .resistivity.
       For example inputModel.0.resistivity.  The model found by each
       inversion iteration is then output to a new resistivity file with the
       iteration number incremented.  For example: inputModel.1.resistivity,
       inputModel.2.resistivity, ... The corresponding model responses are
       written to inputModel.1.resp, inputModel.2.resp,...
 
 MARE2DEM has the optional parameter:
 
       <output file root> - With this option, the output files are
       named <outputfileroot>.1.resistivity, <outputfileroot>.1.resp,
       named <outputfileroot>.2.resistivity, <outputfileroot>.2.resp,...
 
 
  Shutting down the worker processors:
 
 
    Worker:      1         is done with mare2dem...

و اما دلیل اون خطا Makefile بودش که پارامتر ها به درستی ست نشده بودن (مثلاً MKL_ROOT باید به MKLROOT تغییر پیدا می کرد و چند مورد دیگه)
در نتیجه من قسمت tscc از Makefile رو به صورت زیر تغییر دادم :
ifeq "$(CLUSTER_LC)" "tscc"
   FC    = mpif90
   FFLAGS  = -O2 -fpp -fc=ifort 
   CC    = mpicc
   CFLAGS  = -O2
   # You only need these commands if you are compiling the Metis and SuperLU libs in MARE2DEM/Source/SuperLU and /Metis:
   ARCH = xiar
   ARCHFLAGS = ruv
   RANLIB = ranlib
   BLASDEF = -DUSE_VENDOR_BLAS
   MKLPATH=$(MKLROOT)/lib/intel64 
   MKLINCLUDE=$(MKLROOT)/include 
   BLASLIB = -L$(MKLPATH) -I$(MKLINCLUDE) -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread 
      # -DAdd_ or -DNoChange, this is for the stupid underscore difference between C and Fortran
   SUPERLU_CDEFS = -DAdd_     
endif 

ولی باز یه خطای جدید دادش که با سرچ زدن فهمیدم مشکل از فایل rename.h هستش و خط آخر اونو از :
#define log2                            __log2به این تغییر دادم :
#define log2 METIS__log2و در نهایت دستورات زیر رو زدم تا پارامترهای لازم ست بشن :
export I_MPI_F77=ifort
exoprt I_MPI_F90=ifort
export I_MPI_FC=ifort
export I_MPI_CC=icc
export I_MPI_SHM_LMT=shm
source /opt/intel/compilers_and_libraries_2018.0.128/linux/mkl/bin/mklvars.sh intel64
PATH="$HOME/Source:$PATH"
PATH="/opt/intel/compilers_and_libraries_2018.0.128/linux/mpi/intel64/bin:$PATH"
و در نهایت با دستور زیر کامپایل رو انجام دادم :
make CLUSTER=tscc
البته من کامپایل رو با intel mpi انجام دادم که شما نداشتینش و اگه بعد انجام کارهایی که گفتم بازم به مشکل برخوردین من توضیه می کنم از آخرین نسخه از parallel studio استفاده کنین تا بتونین از کتابخونه ها و Mpi های اینتل استفاده کنین.

آفلاین noyan1367

  • Jr. Member
  • *
  • ارسال: 69
  • جنسیت : پسر
پاسخ : تغییر کامپایلر دیفالت mpif90
« پاسخ #41 : 14 تیر 1397، 09:35 ق‌ظ »
درود
من همه دستورات به غیر از این سه تارو انجام دادم ولی باز همون خطای قبلی اتفاق افتاد.
source /opt/intel/compilers_and_libraries_2018.0.128/linux/mkl/bin/mklvars.sh intel64
PATH="$HOME/Source:$PATH"
PATH="/opt/intel/compilers_and_libraries_2018.0.128/linux/mpi/intel64/bin:$PATH"
من فقط همین نسخه رو با لایسنس قانونی دارم. حالا باید یه راه حلی برای این پیدا کنم.
بازم ازت تشکر میکنم. :)
خيال غرق شدن در نگاه ژرف تو بود
كه دل زديم به درياي بي خيالي ها
قيصرامين پور🌷

آفلاین علی رزم دیده

  • عضو کاربران ایرانی اوبونتو
  • *
  • ارسال: 1244
  • جنسیت : پسر
  • ali76 سابق
پاسخ : تغییر کامپایلر دیفالت mpif90
« پاسخ #42 : 14 تیر 1397، 12:38 ب‌ظ »
خواهش می کنم.

ولی بازم چک کنین ببینین رو سیستمون Intel MPI هستش یا نه.

مثلاً چک کنین ببینین دستور mpiifort یا mpiicc کار می کنن یا اینکه چک کنین ببینین دستور زیر رو سیستمتون خروجی داره یا نه :
echo $MKLROOT
یا مثلاً اسکریپت mklvars.sh روی سیستمون وجود داره یا نه.

اگه دستوراتی عین mpiifort جواب ندادن باید خودتون یه فکری برای لایسنس و نصب نسخه ی آخر بکنین.

آفلاین noyan1367

  • Jr. Member
  • *
  • ارسال: 69
  • جنسیت : پسر
پاسخ : تغییر کامپایلر دیفالت mpif90
« پاسخ #43 : 14 تیر 1397، 01:08 ب‌ظ »
اسکریپت mklvars.sh آره هست.
مسیرشم با اون دستوری که گفتی اینه:
mohammad67@ubuntu:~$ echo $MKLROOT
/opt/intel/composer_xe_2013_sp1.3.174/mkl
mpiifortو mpiicc رو ندارم.فقط mpifort و mpicc هستن.
mohammad67@ubuntu:~$ which mpiifort
mohammad67@ubuntu:~$ which mpiicc
mohammad67@ubuntu:~$ which mpicc
/usr/bin/mpicc
mohammad67@ubuntu:~$ which mpifort
/usr/bin/mpifort
خيال غرق شدن در نگاه ژرف تو بود
كه دل زديم به درياي بي خيالي ها
قيصرامين پور🌷

آفلاین علی رزم دیده

  • عضو کاربران ایرانی اوبونتو
  • *
  • ارسال: 1244
  • جنسیت : پسر
  • ali76 سابق
پاسخ : تغییر کامپایلر دیفالت mpif90
« پاسخ #44 : 14 تیر 1397، 02:03 ب‌ظ »
اگه mpiifort رو داشته باشین می تونیم اینو با موفقیت کامپایلش کنیم.

خروجی این دستور رو چک کنین :
locate mpiifort