Trying to install SDL Perl on Windows 10, problems with "make" (and "dmake" and "gmake") - perl

I am using Windows 10 and Strawberry Perl. I found this nice tutorial on building a 3D engine in Perl. Which requires SDL. For a couple of days I've been trying to install it, but it doesn't work. First I tried via CPAN, no success. No I am trying manually, but I am getting error messages when using "make". If I type "perl -V:make" it says I should use "dmake". If I do so, there's a dmake warning, telling me to use gmake instead. If I do that, there's the following message:
"to undefined at C:/Perl64/site/lib/ExtUtils/Install.pm line 1199. gmake: *** [Makefile:942: pm_to_blib] Error 2"
Any suggestions how to fix this? Or is there an easy (easier) way to install SDL?

It seems like the Perl SDL module uses SDL version 1.2.14, whereas the documentation says
The best course of action is to move to SDL 2.0 or later as quickly as
possible
So, I would recommend looking at the Python bindings PySDL2 instead. The following worked for me on Windows 10:
Downloaded Python 3.8 from here:
https://www.python.org/ftp/python/3.8.2/python-3.8.2-amd64.exe
Then added the following to the User enviroment variables for "Path" (NOTE: at the beginning, not at the end):
%USERPROFILE%\AppData\Local\Programs\Python\Python38
%USERPROFILE%\AppData\Local\Programs\Python\Python38\Scripts
Then, from the command prompt install pysdl2:
>pip install pysdl2
Collecting pysdl2
Downloading https://files.pythonhosted.org/packages/60/ba/ddb48261848874eeb3d54963edbf3c74fff86499746aeb23151f123953bb/PySDL2-0.9.7-py3-none-any.whl (541kB)
|████████████████████████████████| 542kB 2.2MB/s
Installing collected packages: pysdl2
Successfully installed pysdl2-0.9.7
>pip install pysdl2-dll
Collecting pysdl2-dll
Downloading https://files.pythonhosted.org/packages/01/37/f9aa5472fb85ce94507c69110916133ad29b650d2bf277de2cce37d7ad7d/pysdl2_dll-2.0.12-py2.py3-none-win_amd64.whl (2.5MB)
|████████████████████████████████| 2.5MB 3.2MB/s
Installing collected packages: pysdl2-dll
Successfully installed pysdl2-dll-2.0.12
Then, add a new User environment variable PYTHONPATH with value:
%USERPROFILE%\AppData\Local\Programs\Python\Python38\Lib\site-packages
Close the command prompt, and reopen a new one to update the environment variables. Then I created a test Python script:
import sys
import sdl2.ext
resource_dir=r'C:\Users\hakon\AppData\Local\Programs\Python\Python38\Lib\site-packages\sdl2\examples'
RESOURCES = sdl2.ext.Resources(resource_dir, "resources")
sdl2.ext.init()
window = sdl2.ext.Window("Hello World!", size=(640, 480))
window.show()
factory = sdl2.ext.SpriteFactory(sdl2.ext.SOFTWARE)
sprite = factory.from_image(RESOURCES.get_path("hello.bmp"))
spriterenderer = factory.create_sprite_render_system(window)
spriterenderer.render(sprite)
processor = sdl2.ext.TestEventProcessor()
processor.run(window)
sdl2.ext.quit()
and finally run it from the command prompt:
> python test.py

Related

VSCode reports issue with WxWidgets in Linux and MacOS

I can't get VS Code to play nice with WxWidgets on Linux or MacOS. It seems like it's trying to default to MSW and gives an error (detailed below)
The specific question is about VSCode (autocomplete, don't give false errors) with WxWidgets. In command prompt, compiling any Wx project works perfect.
Steps:
VS Code is installed
-Create folder for project. Let's call it /src/hello
-Create a hello.cpp file with code from: https://docs.wxwidgets.org/3.0/overview_helloworld.html
-Download WxWidgets into /src/hello/deps
-Going through steps to compile and install Wx https://docs.wxwidgets.org/trunk/plat_osx_install.html
-Check my Intellisense includes to include ${workspaceFolder}/**
-Now, in the command prompt, if I run:
g++ hello.cpp 'wx-config --cxxflags --libs' -o hello
./hello runs perfect!
But in VSCode is unusable because it's giving me this error:
cannot open source file "../../../lib/vc_lib/msw/wx/setup.h" (dependency of "wx/wxprec.h")
I'm pretty sure msw is for windows?
I feel like I've tried everything:
-Downloaded and Git version of Wx (Yeah, I know it's the same. But people on the wx forums recommended trying...)
-Use the Homebrew WxWidgets install.
-Using the sample projects included with Wx.
-Using the Hello World
-Same issues in Linux and MacOS.
-Updating Intellisense's includes every way you can think of.
-Using the output of wxconfig and putting the cxxflags and lib include output into Intellisense.
Is anyone able to use VS Code on Linux or MacOS with the Hello World Wx example? If so what are your intellisense settings?
My properties:
I'd rather not use Cmake for this.

How can I fix the attribute error in VS code when the same code runs perfectly on colab?

I was running the PySINDy package and I kept on getting the module not found-error when I ran this:
pip install pysindy
import pysindy as ps
I fixed this by downgrading the Python in my VS code to 3.8.9. But I do get the following note:
note: This error originates from a subprocess, and is likely not a problem with pip.Note: you may need to restart the kernel to use updated packages.
I am now getting the attribute error when I run the following:
differentiation_method = ps.FiniteDifference(order=2)
Here's the error:
AttributeError: module 'pysindy' has no attribute 'differentiation'
Can someone please help me with this? (I successfully ran the entire code earlier on google colab and the online Jupyter, but I am unable to do it locally. I use MAC os and Jupyter via VS Code.)

Linking problems with nix package manager and termux

I tried to install the nix package manager on an Android device with termux.
When I try to execute the nix applicatives (for instance nix-store or nix-env) I get the following error
/nix/store/y9mfv3sx75mbfibf1zna1kq9v98fk2nb-nix-1.11.16/bin/nix-env:
error while loading shared libraries:
/nix/store/kfk65xrfzndyyz6if5fxk4wrwz76h2lh-glibc-2.25-49/lib/libc.so:
invalid ELF header
The file seems to be a script for the GNU linker, so I'm wondering what is the problem, could it be that termux's version of ld is unable to correctly interpret GNU Linker's scripts?
Thanks in advance for any help.
Edit: It seems that if unset the LD_PRELOADED and the LD_LIBRARY_PATH variables the nix-applications work fine. Problem is that in doing so termux cannot lunch any other non nix application, such as bash for instance.

Installing Tensorflow from source

I've been trying to install Tensorflow and get it working over the past few days. Whilst I have managed to install TF and get it working as tested by opening Python in the terminal and typing,
import tensorflow as tf
I have not been successful attempting to retrain Inception v3. I managed to install it from source once by following the instructions laid out here however I am no longer able to do so. When I get to the section 'Create the pip package and install' and go to run bazel build -c opt //tensorflow/tools/pip_package:build_pip_package in the root of my Tensorflow directiory I get the following error.
kieran#kieranUbuntu:~/tensorflow$ bazel build -c opt //tensorflow/tools/pip_package:build_pip_package
ERROR: /home/kieran/tensorflow/tensorflow/core/BUILD:1068:1: no such target '//tensorflow/tools/git:gen/spec.json': target 'gen/spec.json' not declared in package 'tensorflow/tools/git' defined by /home/kieran/tensorflow/tensorflow/tools/git/BUILD and referenced by '//tensorflow/core:version_info_gen'.
ERROR: /home/kieran/tensorflow/tensorflow/core/BUILD:1068:1: no such target '//tensorflow/tools/git:gen/head': target 'gen/head' not declared in package 'tensorflow/tools/git' defined by /home/kieran/tensorflow/tensorflow/tools/git/BUILD and referenced by '//tensorflow/core:version_info_gen'.
ERROR: /home/kieran/tensorflow/tensorflow/core/BUILD:1068:1: no such target '//tensorflow/tools/git:gen/branch_ref': target 'gen/branch_ref' not declared in package 'tensorflow/tools/git' defined by /home/kieran/tensorflow/tensorflow/tools/git/BUILD and referenced by '//tensorflow/core:version_info_gen'.
ERROR: Analysis of target '//tensorflow/tools/pip_package:build_pip_package' failed; build aborted.
INFO: Elapsed time: 3.063s
This is the same error I ran into when I managed to install it and then attempted retaining the classifier following this tutorial. At the section, bazel build tensorflow/examples/image_retraining:retrain.
I just can't figure out what is going wrong and I have been trying for so long.
I'm using this pip version, # Ubuntu/Linux 64-bit, CPU only, Python 2.7
I think you should search before ask, This link can probably solve your issue.
The issue lied in the incorrect use of ./configure. Whilst it was ran I currently have two versions of python on my computer, both of which are stored in different locations, when running ./configure I pointed it to the wrong python version. After rectifying the issue everything worked correctly.

rj not installing for eclipse/R Statet

I realize there are several posts on this, so apologies if I'm breaching etiquette. In my case, I've tried several of them, and I just can't seem to get the rj issue (of having it installed properly) resolved.
I tried the CMD INSTALL recommendation and literally copied the tar file to my R executable directory
R CMD INSTALL --no-test-load rj_*.tar.gz
I used a DOS cmd window to run it, and it failed using the * notation, so I substituted the exact rj tar file name by navigating to the path...
C:\Program Files\R\R-2.12.1\bin\x64\rj_0.5.0-5.tar.gz
and running
R CMD INSTALL --no-test-load rj_0.5.0-5.tar.gz
This seemed to work as R shows all Java packages installed (inc. Rjava)
> ("rj" %in% installed.packages()[,"Package"])
[1] TRUE
> ("rJava" %in% installed.packages()[,"Package"])
[1] TRUE
>
Yet, in the eclipse environment, I'm still getting rj missing error.
Any thoughts on what to try next? I really want to get the debug capability to work here and pulling my hair out over this.
Oh, and also even though it shows installed in R. If I try to launch inside R, I get:
> library(rj)
Error : .onLoad failed in loadNamespace() for 'rj', details:
call: .jcall("de/walware/rj/server/RJ", "Lde/walware/rj/server/RJ;",
error: RcallMethod: cannot determine object class
Error: package/namespace load failed for 'rj'
Using Eclipse SDK Version: 3.8.0
StatET 3.01.02
rj_0.5.0-5