Installation on Windows Linux Subsystem: Difference between revisions

From Flooxs
Jump to navigation Jump to search
 
(30 intermediate revisions by 2 users not shown)
Line 8: Line 8:


2. Navigate to the Windows Store. Search for Ubuntu and install the program
2. Navigate to the Windows Store. Search for Ubuntu and install the program
3. Open the Bash/Ubuntu terminal that you just installed. Run the following commands (They may require a system restart between them):
        $ sudo do-release-upgrade -p
        $ sudo apt install tk tk-dev tcl tcl-dev libsuitesparse-dev libplplot-dev plplot-tcl
4. Open your ~/.bashrc. Add or make sure the following lines are in the file:
        make ARCH=linux depend
        make ARCH=linux
        Add /src/pyplot/Makefile.linux.depend


If you've never used Linux / Unix before, you might find the following flooxs installation instructions confusing. I've started a page to explain some [[basic unix concepts]] that held me up as I was learning and trying to install flooxs.
If you've never used Linux / Unix before, you might find the following flooxs installation instructions confusing. I've started a page to explain some [[basic unix concepts]] that held me up as I was learning and trying to install flooxs.
Line 24: Line 16:


= Get Your Flooxs! =
= Get Your Flooxs! =
== From Download ==
1. Download the software and put it on your hard drive in a directory called flooxs
1. Download the software and put it on your hard drive in a directory called flooxs
         $ mkdir ~/flooxs
         $ mkdir ~/flooxs
         - go to [http://www.flooxs.tec.ufl.edu/download.html], download the latest linux executable file (get the one that says linux)
         - go to [[Download]]
, download the latest linux executable file (get the one that says linux)


2. Unpack the flooxs file
2. Unpack the flooxs file
This should make a directory called rel2008. Put it in your new Flooxs folder by copying it from its location in Windows to Bash/Ubuntu:  
This should make a directory called rel2008. Put it in your new Flooxs folder by copying it from its location in Windows to Bash/Ubuntu:  
        $ cp /mnt/c/Users/[Windows Username]/[File Location] ./[Location you want Flooxs in Bash/Ubuntu]
        $
        arch  bin  help  lib  Params  src  support  TclLib  Test


To install flooxs, we first must install several supporting programs (such as math or graphing packages) in the support directory. Then, we will go into the src (short for "source") directory and compile flooxs from there.
        $ cp /mnt/c/Users/[Windows Username]/[File Location] [Location you want Flooxs in Bash/Ubuntu]
 
== From Git ==
Clone the Git repository. You need to have git permissions from Mark Law
        $ git clone https://github.com/marklaw59/flooxs.git


= Edit FLOOXS Library Paths in your Arch File =
= Edit FLOOXS Library Paths in your Arch File =
In this section, we will edit a long list of library paths contained in your arch file. These paths tell flooxs where you have installed all the packages from above. First, let's find the file with all these paths:
You should have no issues with libraries if you use the linux arch file provided to you ([[linux]]). However, if you do have issues with libraries then you must locate the directories of the libraries and put the paths into the $FLXSHOME/arch/Linux file.
        $ cd $FLXSHOME/arch
        $ cp linux64 linux64_bk ;# (makes a backup)
        $ gedit linux64 &
This part is painstakingly annoying. For *each* path in this file, I had to navigate to that directory in an old, working flooxs directory, find what files were there, and then use
        $ find . -name "*file*" -print
to see where the new ones were. Most of the time you are looking for .h or .a files, which are [http://en.wikipedia.org/wiki/Header_file headers] and [http://en.wikipedia.org/wiki/Library_%28computing%29 library files] respectively.


Here is my completed arch file that resulted in a successful compile and future operation of flooxs: [[linux64]]. You can see I commented out the old paths with #, and put my new paths underneath.
= Compile Flooxs =
== Install Public Domain Libraries used in the compilation ==
3. Open the Bash/Ubuntu terminal that you just installed. Run the following commands (They may require a system restart between them):
        sudo do-release-upgrade -p
        sudo apt update && sudo apt upgrade
        sudo apt install tk tk-dev tcl tcl-dev libsuitesparse-dev libplplot-dev plplot-tcl plplot-driver-cairo libopenblas-dev


= Compile Flooxs =
== Set the required environment variable ==
4. Open your ~/.bashrc or create a FLOOXS environment variable script. Add or make sure the following lines are in the file:
        export DISPLAY=localhost:0
        export FLXSHOME=/home/[Your Flooxs Folder Location]
        export PL_LIBRARY=/usr/share/plplot5.13.0/tcl/
Note: the plplot variable depends on the plplot version can vary by linux distribution.
 
5. If you choose a environment variable script, make sure to source the file before using FLOOXS.
 
== Compile ==
If you get warnings, probably this is okay. Errors will never be okay. In general, you should resolve any errors in the "make depend" before trying to make. When you get an error, scroll up to see what directory you were in, check and see what file the error is in, and what line number it is giving you. Most likely if you get errors you simply did not set your paths correctly in your arch file.
If you get warnings, probably this is okay. Errors will never be okay. In general, you should resolve any errors in the "make depend" before trying to make. When you get an error, scroll up to see what directory you were in, check and see what file the error is in, and what line number it is giving you. Most likely if you get errors you simply did not set your paths correctly in your arch file.
Compile with cmake (prefered):
        $ cd $FLXSHOME
        $ mkdir release && cd release
        $ cmake ..
        $ make -j8
        $ sudo make install
Or with make:
         $ cd $FLXSHOME/src
         $ cd $FLXSHOME/src
         $ make depend ARCH=linux
         $ make new ARCH=linux
        $ make ARCH=linux


= Do a CVS update if you want =
= Do a CVS update if you want =
If you are one of Dr. Law's students and you have a login to our computers, you can do a [http://en.wikipedia.org/wiki/Concurrent_Versions_System CVS update] to get the latest version of the flooxs code. Don't worry if you cannot do this. The 2008 version works fine.
If you are one of Dr. Law's students and you have a login to our computers, you can do a [http://en.wikipedia.org/wiki/Concurrent_Versions_System CVS update] to get the latest version of the flooxs code.


First, get cvs (concurrent versioning system) for your Ubuntu:
First, get cvs (concurrent versioning system) for your Ubuntu:
         $ sudo apt-get install cvs
         $ sudo apt-get install cvs
         $ RUN SCRIPT USERNAME
         $ [[setcvsuname.sh]] [Your Login]


When you're done with that, then you can do the CVS update:
When you're done with that, then you can do the CVS update:
         $ cd $FLXSHOME/src
         $ cd $FLXSHOME/src
         $ cvs update
         $ cvs update
         -log into swamp2 with your passwd
         -log in with your passwd


If you do a cvs update, there may be some [http://www.google.com/search?hl=en&client=firefox-a&hs=s8f&rls=com.ubuntu%3Aen-US%3Aofficial&q=resolve+cvs+conflict&aq=f&aqi=g-l1&aql=&oq=&gs_rfai= conflicts] with the new version that the cvs program was not intelligent enough to know how to merge. This is normal. As the intelligent user, you must resolve these conflicts. But how, you ask? Files with conflicts will have conflict markers in them. Conflict markers look like:
If you do a cvs update, there may be some [http://www.google.com/search?hl=en&client=firefox-a&hs=s8f&rls=com.ubuntu%3Aen-US%3Aofficial&q=resolve+cvs+conflict&aq=f&aqi=g-l1&aql=&oq=&gs_rfai= conflicts] with the new version that the cvs program was not intelligent enough to know how to merge. This is normal. As the intelligent user, you must resolve these conflicts. But how, you ask? Files with conflicts will have conflict markers in them. Conflict markers look like:
Line 81: Line 93:
         $ gedit blas.h & # conflict here too
         $ gedit blas.h & # conflict here too


= some other errors I got and how I resolved them =
= Common Issues =
 
 
'''1)''' The plotting utility is not working. Here you most likely did not start Xming or you did not add "export DISPLAY=localhost:0" to your ~/.bashrc
 
'''2)''' Some file names have case issues. Generally fixed with:
    mv LevelSet/LayerGRid.cc LevelSet/LayerGrid.cc
    mv diffuse/newton.cc diffuse/Newton.cc
 
'''3)''' Some files might need a string.h include.  The most common file where this is necessary is src/BasePDE/ErrInfo.h
    #include <string.h>    //to the top of src/BasePDE/ErrInfo.h
 
'''4)''' Makefile.linux.depend doesn't exist. Execute the following:
    touch Makefile.linux.depend
    find . -type d -exec touch Makefile.linux.depend \;
 
'''5)''' For older versions of flooxs, $(MASTER_INCLUDE) is not present in all makefiles.

Latest revision as of 17:00, 9 August 2023

Today is 9/11/2018 - These are notes on how to install instructions for flooxs on 64-bit Ubuntu 18.04 Subsystem for Windows. These instructions are intended for linux/unix beginners.

Get Linux Subsystem for Windows - and check out basic concepts page

First, install the Linux Subsystem for Windows to enable the platform. If you already have Ubuntu installed, skip to step 3.

1. Open the Windows PowerShell as an administrator and run the following command:

       Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

2. Navigate to the Windows Store. Search for Ubuntu and install the program

If you've never used Linux / Unix before, you might find the following flooxs installation instructions confusing. I've started a page to explain some basic unix concepts that held me up as I was learning and trying to install flooxs.

Install Xming on Windows

Navigate to https://sourceforge.net/projects/xming/ in a browser on Windows. Download Xming and install it. This program must either be run before using graphics in Bash/Ubuntu or placed in your startup programs.

Get Your Flooxs!

From Download

1. Download the software and put it on your hard drive in a directory called flooxs

       $ mkdir ~/flooxs
       - go to Download

, download the latest linux executable file (get the one that says linux)

2. Unpack the flooxs file This should make a directory called rel2008. Put it in your new Flooxs folder by copying it from its location in Windows to Bash/Ubuntu:

       $ cp /mnt/c/Users/[Windows Username]/[File Location] [Location you want Flooxs in Bash/Ubuntu]

From Git

Clone the Git repository. You need to have git permissions from Mark Law

       $ git clone https://github.com/marklaw59/flooxs.git

Edit FLOOXS Library Paths in your Arch File

You should have no issues with libraries if you use the linux arch file provided to you (linux). However, if you do have issues with libraries then you must locate the directories of the libraries and put the paths into the $FLXSHOME/arch/Linux file.

Compile Flooxs

Install Public Domain Libraries used in the compilation

3. Open the Bash/Ubuntu terminal that you just installed. Run the following commands (They may require a system restart between them):

       sudo do-release-upgrade -p
       sudo apt update && sudo apt upgrade
       sudo apt install tk tk-dev tcl tcl-dev libsuitesparse-dev libplplot-dev plplot-tcl plplot-driver-cairo libopenblas-dev

Set the required environment variable

4. Open your ~/.bashrc or create a FLOOXS environment variable script. Add or make sure the following lines are in the file:

       export DISPLAY=localhost:0
       export FLXSHOME=/home/[Your Flooxs Folder Location]
       export PL_LIBRARY=/usr/share/plplot5.13.0/tcl/

Note: the plplot variable depends on the plplot version can vary by linux distribution.

5. If you choose a environment variable script, make sure to source the file before using FLOOXS.

Compile

If you get warnings, probably this is okay. Errors will never be okay. In general, you should resolve any errors in the "make depend" before trying to make. When you get an error, scroll up to see what directory you were in, check and see what file the error is in, and what line number it is giving you. Most likely if you get errors you simply did not set your paths correctly in your arch file.

Compile with cmake (prefered):

       $ cd $FLXSHOME
       $ mkdir release && cd release
       $ cmake .. 
       $ make -j8
       $ sudo make install


Or with make:

       $ cd $FLXSHOME/src
       $ make new ARCH=linux

Do a CVS update if you want

If you are one of Dr. Law's students and you have a login to our computers, you can do a CVS update to get the latest version of the flooxs code.

First, get cvs (concurrent versioning system) for your Ubuntu:

       $ sudo apt-get install cvs
       $ setcvsuname.sh [Your Login]

When you're done with that, then you can do the CVS update:

       $ cd $FLXSHOME/src
       $ cvs update
       -log in with your passwd

If you do a cvs update, there may be some conflicts with the new version that the cvs program was not intelligent enough to know how to merge. This is normal. As the intelligent user, you must resolve these conflicts. But how, you ask? Files with conflicts will have conflict markers in them. Conflict markers look like:

               <<<<<<< filename
               your lines
               =======
               other person's lines
               >>>>>> current version"

In this case, you want the other person's line, as this is Dr. Law's new version, and not your old version. Of course, you can always make a backup first. For example, I used this method to find the conflicts, then fixed them by hand:

       $ find $FLXSHOME -name "<<<<<" -print
       $ cd $FLXSHOME/src
       $ cp Makefile Makefile_bk
       $ gedit Makefile &

       $ cd math
       $ gedit Makefile &
       $ gedit blas.h & # conflict here too

Common Issues

1) The plotting utility is not working. Here you most likely did not start Xming or you did not add "export DISPLAY=localhost:0" to your ~/.bashrc

2) Some file names have case issues. Generally fixed with:

   mv LevelSet/LayerGRid.cc LevelSet/LayerGrid.cc
   mv diffuse/newton.cc diffuse/Newton.cc

3) Some files might need a string.h include. The most common file where this is necessary is src/BasePDE/ErrInfo.h

   #include <string.h>     //to the top of src/BasePDE/ErrInfo.h

4) Makefile.linux.depend doesn't exist. Execute the following:

   touch Makefile.linux.depend
   find . -type d -exec touch Makefile.linux.depend \;

5) For older versions of flooxs, $(MASTER_INCLUDE) is not present in all makefiles.