How to install netcdf-fortran on Ubuntu - gfortran

I am using a Fortran software which needs for compilation gfortran and netcdf-fortran.
As working environment I have WSL with Ubuntu 20.04.4 on Windows 10
and gfortran 9.4.0.
After some search I found a description how to build the netcdf Fortran libraries:
https://docs.unidata.ucar.edu/netcdf-c/current/building_netcdf_fortran.html
I downloaded the latest netcdf c release at:
git clone http://github.com/Unidata/netcdf-c netcdf-c
Then I downloaded the latest betcdf-fortran release:
git clone https://github.com/Unidata/netcdf-fortran.git netcdf-fortran
How can I compile/build the newest netcdf-Fortran library having download the netcdf-c and netcdf-fortran projects?

Related

Pydrake has issue with python 3 point 9

Is Python3.9 supported?
I got this error with Python3.9:
File "/home/drake/drake/drake-build/install/lib/python3.6/site-packages/pydrake/common/__init__.py", line 8, in <module> from ._module_py import * ModuleNotFoundError: No module named 'pydrake.common._module_py'
There is no "python3.9" folder in .../install/lib.
I am running Ubuntu 18, and I am building Drake from source with latest github commit in master.
EDIT: Can someone explain how exactly Drake sets up pydrake?
It seems it detects the default Python installation somewhere automatically. I tried with a new installation, the default python was 3.8, and I also install:
apt install -y python3.10
Then I followed Drake python setup instructions.
git clone https://github.com/RobotLocomotion/drake.git
mkdir drake-build
cd drake-build
cmake ../drake
make -j
Pydrake only became available in 3.8. How to make it available for 3.10?
The current version of Pydrake (1.11.0) is officially supported on Ubuntu 20.04 with Python 3.8 and Ubuntu 22.04 with Python 3.10 when building from source. However, we recommend that most users use a binary release, and don't try to rebuild Drake from scratch themselves.
There are precompiled wheels at https://pypi.org/project/drake/ aka pip install drake; helpful installation details are at https://drake.mit.edu/pip.html. The wheels when run on Ubuntu support Python versions 3.8, 3.9, 3.10, or 3.11.
For example:
python3 -m venv env
env/bin/pip install --upgrade pip
env/bin/pip install drake
source env/bin/activate
For additional details, see https://drake.mit.edu/installation.html for full instructions and supported versions.
The last version of Pydrake to support Ubuntu 18.04 was v1.1.0 (released in March of 2022). If you need a newer version of Pydrake, you'll need to use a newer version of Ubuntu.

can't find OpenCV package on RHEL 8

Some sites say OpenCV could be installed on RHEL from the system repository:
sudo yum install opencv opencv-devel opencv-python
I run RHEL UBI container redhat/ubi8 and tried to install OpenCV - package is not found.
Then I install EPEL repos from https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm, same result. The only opencv-related package is libfreenect-opencv.
I understand I could compile OpenCV from the scratch, but I'd like to go with already compiled package.
You need to enable CodeReady Linux Builder Repository on RHEL 8:
subscription-manager repos --enable codeready-builder-for-rhel-8-x86_64-rpms

Cannot import MSTL from statsmodels

I am currently trying to import MSTL from statsmodels.tsa.seasonal the module of MSTL (https://www.statsmodels.org/devel/generated/statsmodels.tsa.seasonal.MSTL.html) but it returns an ImportError. I have installed statsmodels from conda on MAC M1 2020
I just had the same issue and did some research.
It seems that MSTL is only available on the most recent version of statsmodels: version 0.14.0
If you install statsmodels using conda install -c conda-forge statsmodels,
you will get the statsmodels 0.13.2 version.
(Using a script editor, try searching for 'MSTL' through C:\Users{username}\Anaconda3\Lib\site-packages\statsmodels, or wherever statsmodels is installed on your machine, you will probably not find it)
You'll need to install the most recent version from the latest source on statsmodels's github repository:
www.statsmodels.org/dev/install.html
From the anaconda prompt:
git clone https://github.com/statsmodels/statsmodels.git
pip install git+https://github.com/statsmodels/statsmodels
You will need a C compiler and git installed
For git you can use: conda install -c anaconda git
Be careful as the installation of the newest version may interfere with your other installed python packages.
I would recommend that you use a conda virtual environment for this.

How can I compile opencv from source at Win 10

I read this and this, and saw the videos, but looks I did not understand the required :(
I need to compile opencv from source in order to be able to use CV-Rust at my application, what I did is:
1- Downloaded and installed Visual Studio 2015 with Visual C++ option.
2- Downloaded and installed CUDA
3- Downloaded and installed Python
4- Downloaded and installed Tortoisegit
5- Downloaded and installed 7-zip
6- Downloaded and installed Miktex
7- Downloaded and installed DoxyGen
8- Upgraded the pip python -m pip install --upgrade pip and installed the below packages:
8-1- Setuptools as pip install setuptools
8-2- Sphinx as pip install -U Sphinx
8-3- NumPy as pip install NumPy
9- Downloaded and extracted the following, and put all the extracted folders in a seperate folder called it dep:
9-1- Threading Building Blocks 2018 Update 6 _win.zip
9-2- OpenEXR .tar.gz
9-3- Eigen .zip
10- Downloaded and unzipped the OpenCV winpack
11- Closed in another folder the OpenCV github using Tortoisegit
What is required now!
I'll summarize the issue I raised at github and its solution below:
It looks I was having some conflicts in my machine setup:
I was not having required permission to execute scripts as the PS, so I added the required permission as mentioned here, by writing:
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
Also, I was installing VS2017 and VS2015 which was appeared to be causing some kind of conflict, so I uninstalled VS2017 as shown here and removed Win10 SDK as well.
Confirmed Cmake is installed properly and added to the path, by running cmake -version
Then I downloaded the cv-rs repository.
Then created directory C:\opencv
In the file explorer, enabled see hidden folders, to see the .git
Then copied both .git and .windows folders to the C:\opencv
Opened powershell console as administrator in c:\opencv
Run the below commands in PS:
PS C:\opencv> git reset --hard
PS C:\opencv> git submodule update
PS C:\opencv> .\.windows\msvc_2_build_OCV.ps1 -EnableCuda $False -Compiler vc14
It will take sometime running the script and configuring opencv.

How to generate .deb from catkin workspace in ROS

I can compile and install ROS package in the catkin workspace in ROS. How can I export the package in catkin workspace to a .deb file so I can install and use it on the other machines?
My ROS version is ROS Indigo and OS version is Ubuntu 14.04
Here is a step-by-step guide of doing it using ROS bloom:
Navigate to your package path
cd /path/to/package
Use ROS bloom to create the .deb file
bloom-generate rosdebian --os-name ubuntu --ros-distro kinetic fakeroot debian/rules binary
* If your ROS distribution is different from Kinetic, replace kinetic with your distribution
Copy the .deb file to the other machine, and in its folder type
sudo dpkg -i packagename.deb
this will install the package on that machine, and you are now able to use it like any other ROS package
1 - I think the ROS build farm would be a good starting point and solution for that. You cannot create a .deb as you said but, you can create a source closed ROS packages
The ROS build farm is also designed to enable deploying a custom build farm. This can be useful to release closed-source packages, build for platforms and architectures not provided by the official ROS build farm, and/or customize any part of the process to specific needs.
Take a look here for a better overview.
2 - Another approach would be using a CMake install. Although this will require the same architecture and ROS Distro between both your platforms and a location that can be the same for both machines.
Define a CMAKE_INSTALL_PREFIX for some location like: /opt/your_ros_install.
Run sudo make install to allow installing there.
Copy the install directory from machine A to machine B, using scp or tar or some other technique.
To run your installed ROS packages on either machine: source /opt/your_ros_install/setup.bash.
Take a look at this post: Generate .deb from ROS package
Use the following commands:
path-of-your-package$ bloom-generate rosdebian --os-name ubuntu --ros-distro kinetic
$fakeroot debian/rules binary

Resources