Julia 0.4.5: libz fails to load on Ubuntu - julia

While I was attempting to use Requests in Julia, the following error was output:
julia> using Requests
INFO: Precompiling module Requests...
ERROR: LoadError: LoadError: error compiling version: could not load library "libz"
libz: cannot open shared object file: No such file or directory
while loading /home/michael/.julia/v0.4/Libz/src/lowlevel.jl, in expression starting on line 110
while loading /home/michael/.julia/v0.4/Libz/src/Libz.jl, in expression starting on line 11
ERROR: LoadError: Failed to precompile Libz to /home/michael/.julia/lib/v0.4/Libz.ji
while loading /home/michael/.julia/v0.4/Requests/src/Requests.jl, in expression starting on line 27
ERROR: Failed to precompile Requests to /home/michael/.julia/lib/v0.4/Requests.ji
in compilecache at ./loading.jl:400
I'm not knowledgeable enough in Julia to discern exactly what is happening, but here is the code from Libz.jl (line 11)...
include("lowlevel.jl")
...from lowlevel.jl (lines 103-110)...
# Functions
# ---------
function version()
return unsafe_string(ccall((:zlibVersion, zlib), Ptr{UInt8}, ()))
end
const zlib_version = version()
...and from Requests.jl (line 27)
using Libz
This problem has persisted after I've removed then reinstalled Libz, MbedTLS, and Requests, and after I've Pkg.update()'ed and restarted julia and my computer. Is anyone well enough versed in Julia to know how to fix this?

Per the comment by Gnimuc K and a tiny bit more research:
sudo apt-get install zlib1g-dev
installs zlib, which Julia needed. Once it was installed...
julia> Pkg.update()
julia> Pkg.build("Libz")
worked all the kinks out.

Related

pyOptSparse Error: There was an error importing the compiled snopt module during testing of OpenMDAO

I need to use open framework openMDAO for my project in Ubuntu. I have successfully installed mpi4py, petsc, petsc4py by creating new environment in anaconda. I have also installed pyoptsparse and other libraries.
After installation when I run test command $ testflo openmdao -n 1
It gives error as:
(omd) mujahed#Lenovo-G50-80:~$ testflo openmdao -n 1
.............................................................................
+------------------------------------------------------------------------------+
| pyOptSparse Error: There was an error importing the compiled snopt module |
+------------------------------------------------------------------------------+
SSS......../home/mujahed/anaconda3/envs/omd/lib/python3.8/site-packages/openmdao/core/group.py:1113: UserWarning:Group (sub): Attempted to connect from 'tgt.x' to 'cmp.x', but 'tgt.x' is an input. All connections must be from an output to an input.
.......................................................................................................................................................................................................................................................................................................................................................S...............................................................................................................................S........................................................................S.SS........................................................................................................................................................................................................................................................................SSS.SSSSSS..S.................................................................................................................................................................................................................................................................................................................S.......
+------------------------------------------------------------------------------+
| pyOptSparse Error: There was an error importing the compiled snopt module |
+------------------------------------------------------------------------------+
.....................................................................(mpi) /home/mujahed/anaconda3/envs/omd/lib/python3.8/site-packages/openmdao/core/tests/test_prob_remote2.py:ProbRemoteTestCase.test_get_remote ... FAIL (00:00:0.02, 203 MB)
Traceback (most recent call last):
File "/home/mujahed/anaconda3/envs/omd/lib/python3.8/site-packages/testflo/test.py", line 425, in _try_call
func()
File "/home/mujahed/anaconda3/envs/omd/lib/python3.8/site-packages/openmdao/core/tests/test_prob_remote2.py", line 200, in test_get_remote
prob.get_val('par.c2.x', get_remote=False)
File "/home/mujahed/anaconda3/envs/omd/lib/python3.8/unittest/case.py", line 227, in __exit__
self._raiseFailure("{} not raised".format(exc_name))
File "/home/mujahed/anaconda3/envs/omd/lib/python3.8/unittest/case.py", line 164, in _raiseFailure
raise self.test_case.failureException(msg)
AssertionError: RuntimeError not raised
...
+------------------------------------------------------------------------------+
| pyOptSparse Error: There was an error importing the compiled snopt module |
+------------------------------------------------------------------------------+
SSS...............................................S.....X......................................................................................................................................................................................
+------------------------------------------------------------------------------+
| pyOptSparse Error: There was an error importing the compiled snopt module |
+------------------------------------------------------------------------------+
..SS............S...capi_return is NULL
Call-back cb_slfunc_in_slsqp__user__routines failed.
.capi_return is NULL
Call-back cb_slfunc_in_slsqp__user__routines failed.
....S..........................SSSSSSS.......
Normal return from subroutine COBYLA
NFVALS = 56 F =-1.080000E+02 MAXCV = 0.000000E+00
X = 3.500001E+00 -3.500001E+00
.................................................
Normal return from subroutine COBYLA
NFVALS = 124 F =-2.733333E+01 MAXCV = 0.000000E+00
X = 6.666667E+00 -7.333332E+00
.....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................SSSSSSSSSSSSSSSSSSSSSSSS..............
Normal return from subroutine COBYLA
NFVALS = 54 F =-2.700000E+01 MAXCV = 0.000000E+00
X = 6.999999E+00 -6.999999E+00
.............................................SSS..............................................................................................................S...........................................................................................................................................................................................................................................................................................................................................................
The following tests failed:
test_prob_remote2.py:ProbRemoteTestCase.test_get_remote
Passed: 2619
Failed: 1
Skipped: 62
Ran 2682 tests using 1 processes
Wall clock time: 00:22:33.07
Passed: 2619
Failed: 1
Skipped: 62
I don’t have computer science background and this is the first time I am dealing with something like this.
I am using:
openMDAO 3.2.1
mpich 3.3.2
mpi4py 3.0.3
petsc 3.13.4
petsc4py 3.13.0
pyoptsparse 2.1.5
python 3.8.5
I have build pyoptsparse from https://github.com/OpenMDAO/build_pyoptsparse by command ./build_pyoptsparse.sh.
I have Ubuntu 20.04.1 LTS and I am using Anaconda3. How can I pass all the tests (Without skipping)?
Can please anyone help me with this?
Apologies for this.. it looks like an extraneous file (test_prob_remote2.py) made it into the distribution.. This is not a legitimate test and you can ignore it.
The "pyOptSparse Error" messages are just telling you that you don't have the SNOPT optimizer installed, which is fine.
Your installation should be good.
Some of that test output can be a bit confusing. The error you're getting isn't actually with SNOPT. Thats a warning spit out by pyoptsparse, but it is not a problem.
The actual failed test is identified by this line:
The following tests failed:
test_prob_remote2.py:ProbRemoteTestCase.test_get_remote
And the error that causes the failure is here:
File "/home/mujahed/anaconda3/envs/omd/lib/python3.8/site-packages/testflo/test.py", line 425, in _try_call
func()
File "/home/mujahed/anaconda3/envs/omd/lib/python3.8/site-packages/openmdao/core/tests/test_prob_remote2.py", line 200, in test_get_remote
prob.get_val('par.c2.x', get_remote=False)
File "/home/mujahed/anaconda3/envs/omd/lib/python3.8/unittest/case.py", line 227, in __exit__
self._raiseFailure("{} not raised".format(exc_name))
File "/home/mujahed/anaconda3/envs/omd/lib/python3.8/unittest/case.py", line 164, in _raiseFailure
raise self.test_case.failureException(msg)
AssertionError: RuntimeError not raised
For some reason your install isn't raising an error when one is expected. Im not sure why thats going on, but if you're not planning to run with MPI then its not a problem.
You have bothered to install MPI, so you are probably be planning to run things in parallel... this one failed test is certainly odd. If you had a serious problem with your MPI install you would get more failed tests I think.
You could try running testflo like this:
testflo openmdao -n 1 --show_skipped to see if more MPI tests are being skipped... that might help you narrow it down.

GLM Precompile Error In Julia Pro 1.0/1.2

Hello internet friends,
I am using the Julia Pro v.1.0.5-2 IDE to render animations for some Condensed Matter Physics data. When I attempt to run:
array = load("C:/Users/Kyle/Desktop/julia/data/Psi_L=89_W=0_0.01_500000-500/Psi_L=89_W=0_g=0.0_L^2.jld", "data")
#gif for i=1:7
array_2 = abs2.(array[i][:,:,1])
x=1:89
y=1:89
f(x,y) = array_2[x,y]
plot(x,y,f,st=:surface,camera=(0,30), title = "Wavefunction Density Animation, L=89, g=0, t = $(5*i)")
end
I get the following error:
[ Info: Precompiling GLM [38e38edf-8417-5370-95a0-9cbb8c7f171a]
ERROR: LoadError: No deps.jl file could be found. Please try running Pkg.bui
Currently, the build command might fail when Julia has been built from sourc
and the recommendation is to use the official binaries from julialang.org.
For more info see https://github.com/JuliaLinearAlgebra/Arpack.jl/issues/5.
ERROR: LoadError: LoadError: Failed to precompile Arpack [7d9fca2a-8960-54d3aPro_v1.0.5-2\compiled\v1.0\Arpack\X5VZL.ji.
in expression starting at C:\Users\Kyle\.juliapro\JuliaPro_v1.0.5-2\packages
in expression starting at C:\Users\Kyle\.juliapro\JuliaPro_v1.0.5-2\packages
ERROR: LoadError: Failed to precompile PDMats [90014a1f-27ba-587c-ab20-58faa-2\compiled\v1.0\PDMats\wuzEE.ji.
in expression starting at C:\Users\Kyle\.juliapro\JuliaPro_v1.0.5-2\packages
ERROR: LoadError: Failed to precompile Distributions [31c24e10-a181-5473-b8e_v1.0.5-2\compiled\v1.0\Distributions\xILW0.ji.
in expression starting at C:\Users\Kyle\.juliapro\JuliaPro_v1.0.5-2\packages
ERROR: LoadError: Failed to precompile GLM [38e38edf-8417-5370-95a0-9cbb8c7fcompiled\v1.0\GLM\6OREG.ji.
When I attempt to run:
Pkg.build("Arpack")
I get the following error:
Pkg.build("Arpack")
Building Arpack → `C:\Users\Kyle\.juliapro\JuliaPro_v1.0.5-2\packages\Arpa
┌ Error: Error building `Arpack`:
│ ┌ Warning: Platform `x86_64-w64-mingw32-libgfortran4` is not an officially
│ └ # BinaryProvider C:\Users\julia\AppData\Local\Julia-1.0.5\share\julia\st
It is important to mention that I had produced several animations with no problems with the same exact code. I stopped to go through some emails and when I tabbed back and ran the code with new parameters, it broke as I described. Furthermore, all the relevant packages are installed (except the ones that threw these errors) and "using [xpackage]" are sprinkled in appropriately.
Thanks for taking the time to read!
Unfortunately, Arpack >=0.3.2 is incompatible with JuliaPro 1.2.0-1. To work aound this issue, you can either ] add Arpack#0.3.1 or install JuliaPro version 1.2.0-2.

Linking PHPUnit with PhpStorm

PHPUnit: 4.8.31
PhpStorm: 2016.1
I'm having issues running PHPUnit from within PhpStorm. From a CMD window, running the test works fine, but the PhpStorm output is this:
"C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-binaries\php\php704vc14x86x161109103716\php.exe" C:/Users/username/AppData/Local/Temp/ide-phpunit.php --no-configuration "C:\tests"
Testing started at 5:30 PM ...
Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-binaries\php\php704vc14x86x161109103716\ext\php_curl.dll' - The specified procedure could not be found.
in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-binaries\php\php704vc14x86x161109103716\ext\php_curl.dll' - The specified procedure could not be found.
Fatal error: Class 'PHPUnit_TextUI_ResultPrinter' not found in C:\Users\username\AppData\Local\Temp\ide-phpunit.php on line 253 in Unknown on line 0
PHP Fatal error: Class 'PHPUnit_TextUI_ResultPrinter' not found in C:\Users\username\AppData\Local\Temp\ide-phpunit.php on line 253
Process finished with exit code 255
I've included the folder with my phpunit.phar library in PhpStorm:
PhpStorm knows about the include paths, autocomplete works.
The run config looks like this:
The PHP version/install I'm using is the same one.
Windows:
PhpStorm:
Any ideas?
I tried running a script that uses curl from a CMD window and saw that the curl library wasn't loaded.
I did phpinfo(); and saw that the CMD window was using a different PHP installation (I had installed a new EasyPHP version).
I made the windows sys variable PATH point at my old one, then it started throwing some errors about not loading some libraries (php_curl.dll, libssh2.dll), so I moved them from the new install folder to the old one and to Windows\SysWOW64.
Miraculously, the PhpStorm run config was also fixed, which leads me to believe it doesn't use the interpreter I set in its options, but rather the one from PATH..
The PhpStorm output is now:
"C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-binaries\php\php704vc14x86x161109103716\php.exe" C:/Users/username/AppData/Local/Temp/ide-phpunit.php --no-configuration "C:\tests"
Testing started at 9:22 AM ...
Warning: The use statement with non-compound name 'PHPUnit_Framework_TestCase' has no effect in C:\DummyTest.php on line 3
PHPUnit 4.8.31 by Sebastian Bergmann and contributors.
PHP Warning: The use statement with non-compound name 'PHPUnit_Framework_TestCase' has no effect in C:\DummyTest.php on line 3
No tests found in class "TestDummy".
Time: 372 ms, Memory: 10.00MB
FAILURES!
Tests: 1, Assertions: 0, Failures: 1.
Process finished with exit code 1

Cannot run Julia script from command line in .julia directory

When I try to run a script in the .julia directory from the command line it fails, example below:
D:\MyProjects\Julia\.julia\v0.4\Mocha\tools>julia plot_statistics.jl
ERROR: could not open file d:\myprojects\julia\plot_statistics.jl
in include at boot.jl:261
in include_from_node1 at loading.jl:320
in process_options at client.jl:280
in _start at client.jl:378
D:\MyProjects\Julia\.julia\v0.4\Mocha\tools>julia "d:\MyProjects\Julia\.julia\v0.4\Mocha\tools\plot_statistics.jl"
ERROR: LoadError: ArgumentError: ArgParse not found in path
in require at loading.jl:249
in include at boot.jl:261
in include_from_node1 at loading.jl:320
in process_options at client.jl:280
in _start at client.jl:378
while loading d:\MyProjects\Julia\.julia\v0.4\Mocha\tools\plot_statistics.jl, in expression starting on line 2
Notice in the first attempt the error message is missing a significant portion of the path, everything from .julia on.
In the second attempt I try to give the full path, but Julia rejects that too.
Windows 10; Julia is on the path (e.g. julia enters the REPL); Julia ver. 0.4.5

Serf 1.3.8 install using scons is failing

I am using Redhat 6.6 and installed scons and using scons to install serf 1.3.8 but seeing the below error. Anyone has faced the below error. I am stuck and i need serf for http/https access for svn 1.9. Seeking advice for below error. I followed below URL. "http://www.linuxfromscratch.org" site for install procedure. I see error while executing cmd "/local//scons-2.4.1/script/scons check"
Has anyone know the solution or alternative to install serf to bypass this option and install serf without no issues
scons: Building targets ... test/test_buckets.c: In function
'test_deflate_4GBplus_buckets': test/test_buckets.c:1559: warning: integer
overflow in expression scons: *** [test/test_buckets.o] Error 1 scons: building
terminated because of errors.
Please advice.
[EDIT]
What env variables are required for scons to work properly. I see different error, i messed the environment. Seeing the below error. Any idea what I have missed. I have the custom install for python7. I have added the python install path to PATH,LD_LIBRARY_PATH. Error is below. Import failed. Unable to find SCons files in: /local/appln/pkgs/scons-2.4.1/bin/../engine /local/appln/pkgs/scons-2.4.1/bin/scons-local-2.4.1 /local/appln/pkgs/scons-2.4.1/bin/scons-local /usr/lib/scons-2.4.1 /usr/local/lib/scons-2.4.1 /local/apps/pkgs/scons-2.4.1/lib/python2.6/site-packages/scons-2.4.1 /usr/lib/python2.6/site-packages/scons-2.4.1 /usr/local/lib/python2.6/site-packages/scons-2.4.1 /usr/lib64/scons-2.4.1 /local/apps/pkgs/scons-2.4.1/lib/scons /usr/lib/scons /usr/local/lib/scons /local/appln/pkgs/scons-2.4.1/lib/python2.6/site-packages/scons /usr/lib/python2.6/site-packages/scons
/usr/local/lib/python2.6/site-packages/scons /usr/lib64/scons
Traceback (most recent call last): File "/local/appln/pkgs/scons-2.4.1/bin/scons", line 190, in import SCons.Script
ImportError: No module named SCons.Script
[Closed]

Resources