For PostgreSQL, I have compiled zlib 1.2.11 on msvc 2022. After compiling zlib I got following list of files.
Directory of C:\Users\Documents\zlib_build\zlib-1.2.11\contrib\vstudio\vc14\x86\ZlibDllRelease
02/04/2022 11:33 AM <DIR> .
02/04/2022 11:33 AM <DIR> ..
02/04/2022 11:33 AM <DIR> Tmp
02/04/2022 11:33 AM 143,360 vc143.pdb
02/04/2022 11:33 AM 422,912 zlibwapi.dll
02/04/2022 11:33 AM 16,800 zlibwapi.exp
02/04/2022 11:33 AM 28,330 zlibwapi.lib
02/04/2022 11:33 AM 759,073 zlibwapi.map
02/04/2022 11:33 AM 6,696,960 zlibwapi.pdb
6 File(s) 8,067,435 bytes
3 Dir(s) 24,997,359,616 bytes free
But when I use the above Zlib library to compile PostgreSQL, I'm getting the following error.
LINK : fatal error LNK1181: cannot open input file 'C:\library\zlib_build\ZlibDllRelease\lib\zdll.lib'
This is the first time I compiled Zlib library, Is there any step I'm missing with which I would have gotten zdll.lib file. Or do I need to change anything related to Postgres compilation so that It would use zlibwapi.lib?
I couldn't find a way around zlibwapi, but found an easier way to build the zlib(1.2.11) library.
Open "Developer Command Prompt" from Visual studio.
Go to main zlib directory where source is uncompressed and run the following command to build it.
nmake -f win32/Makefile.msc
this command can be found in win32/Makefile.msc
There we will get all the library files related to zlib in the current directory.
Further, if required create a separate dir(zlib_build) and copy files to the respective directories as follows.
zlib_build\lib -> zdll.*, zlib.*
zlib_build\bin -> zlib1.*
zlib_build\include -> zlib.h, zconf.h
After using this in the path, I built PostgreSQL successfully.
Related
I'm trying to compile my first ESP32 example project.
I set up Visual Studio Code with all the latest tools. (Python, toolschain, etc).
I'm not sure what exactly I need as I'm new in this environment, so maybe I missed something.
I followed the user guide on how to create and compile the first project, I used the Blink project from the example folder.
Here is what I get.
> Executing task: cmake -G Ninja .. <
-- Project is not inside a git repository, or git repository has no commits; will not use 'git describe' to determine PROJECT_VER.
-- Building ESP-IDF components for target esp32s2
-- Checking Python dependencies...
Python requirements from C:\Users\dmitryke\esp\esp-idf\requirements.txt are satisfied.
-- Project sdkconfig file C:/ESP32_projects/blink/sdkconfig
Loading defaults file C:/ESP32_projects/blink/sdkconfig.defaults...
-- Components:
-- Component paths:
-- Configuring done
-- Generating done
-- Build files have been written to C:/ESP32_projects/blink/build
The terminal will be reused by tasks, press any key to close it.
> Executing task: cmake --build . <
[1/1] Linking C executable blink.elf
FAILED: blink.elf
cmd.exe /C "cd . && C:\Users\dmitryke\.espressif\tools\xtensa-esp32s2-elf\esp-2020r3-8.4.0\xtensa-esp32s2-elf\bin\xtensa-esp32s2-elf-gcc.exe -mlongcalls CMakeFiles/blink.elf.dir/project_elf_src.c.obj -o blink.elf -Wl,--cref -Wl,--Map=C:/ESP32_projects/blink/build/blink.map -fno-rtti -fno-lto && cd ."
c:/users/dmitryke/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld.exe: c:/users/dmitryke/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/lib/no-rtti/crt0.o:(.literal+0x0): undefined reference to `main'
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
The terminal process "C:\windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command cmake --build ." terminated with exit code: 1.
Terminal will be reused by tasks, press any key to close it.
I removed everything from the blink.c to avoid code errors.
blink.c
#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "driver/gpio.h"
#include "sdkconfig.h"
/* Can use project configuration menu (idf.py menuconfig) to choose the GPIO to blink,
or you can edit the following line and set a number here.
*/
#define BLINK_GPIO 0x01
void app_main(void)
{
while(1) { }
}
Another issue, there is an option to run idf.py menuconfig.
Sometimes it works and sometimes it says:
C:\ESP32_projects\blink>idf.py menuconfig
'idf.py' is not recognized as an internal or external command,
operable program or batch file.
Any help will be appreciated!
All ESP IDF tasks (cmake, idf.py, etc) must be run inside a prepared environment. I would start by losing the VSC (because it's just another potential failure point) and using the basic ESP IDF command prompt. Try running idf.py menuconfig, idf.py build and idf.py -p COMx flash for configuring, building and flashing your test project.
Once you've verified that the ESP IDF environment and your project works, go back to VSC and see what's wrong there.
As a working example, this is how I compile the same sample project on my machine (Linux, ESP IDF v4.2.1) from scratch:
$ cp -r ~/esp-idf/examples/get-started/blink/ .
$ cd blink
$ idf.py build
Running cmake in directory /home/tarmo/tmp/espidftest/blink/build
Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DESP_PLATFORM=1 -DCCACHE_ENABLE=0 /home/tarmo/tmp/espidftest/blink"...
-- Found Git: /usr/bin/git (found version "2.30.2")
-- IDF_TARGET not set, using default target: esp32
-- The C compiler identification is GNU 8.4.0
-- The CXX compiler identification is GNU 8.4.0
[SNIP]
esptool.py v3.0
Generated /home/tarmo/tmp/espidftest/blink/build/bootloader/bootloader.bin
[934/934] Generating binary image from built executable
esptool.py v3.0
Generated /home/tarmo/tmp/espidftest/blink/build/blink.bin
Project build complete. To flash, run this command:
/home/tarmo/espressif/python_env/idf4.2_py3.9_env/bin/python ../esp-idf/components/esptool_py/esptool/esptool.py -p (PORT) -b 921600 --before default_reset
--after hard_reset --chip esp32 write_flash --flash_mode dio --flash_size detect --flash_freq 40m 0x1000 build/bootloader/bootloader.bin 0x8000 build/partition_table/partition-table.bin 0x10000 build/blink.bin
or run 'idf.py -p (PORT) flash'
$ ls -lha
drwxr-xr-x 8 tarmo tarmo 4,0K juuni 4 12:26 build
-rw-r--r-- 1 tarmo tarmo 234 juuni 4 12:25 CMakeLists.txt
-rw-r--r-- 1 tarmo tarmo 1,5K juuni 4 12:25 example_test.py
drwxr-xr-x 3 tarmo tarmo 4,0K juuni 4 12:26 main
-rw-r--r-- 1 tarmo tarmo 177 juuni 4 12:25 Makefile
-rw-r--r-- 1 tarmo tarmo 157 juuni 4 12:25 README.md
-rw-r--r-- 1 tarmo tarmo 33K juuni 4 12:25 sdkconfig
-rw-r--r-- 1 tarmo tarmo 3 juuni 4 12:25 sdkconfig.defaults
The command window is less concerning, i got it working.
My main problem is main not being linked.
I had the same problem with building the ESP-project in VS Code, but found a solution: The project needs to be created in a folder with a different name than the example name.
I tried the blink project and it works when creating it in c:\esp-idf\ rather than in c:\esp-idf\blink. The latter will make a folder named blink within the blink folder.
You can add this code to your main(), checking your esp-idf environment first:
gpio_reset_pin(BLINK_GPIO);
gpio_set_direction(BLINK_GPIO, GPIO_MODE_OUTPUT);
while(1) {
printf("Turning off the LED\n");
gpio_set_level(BLINK_GPIO, 0);
vTaskDelay(1000 / portTICK_PERIOD_MS);
printf("Turning on the LED\n");
gpio_set_level(BLINK_GPIO, 1);
vTaskDelay(1000 / portTICK_PERIOD_MS);
}
Don't forget to close the previous terminal and open it again.
I wanted to give CLion a try for working with the ROS source code. I created a ROS Workspace and have the following folder structure:
joesan#joesan-InfinityBook-S-14-v5:~/Projects/Private/ros-projects$ cd catkin_ws/
drwxrwxr-x joesan joesan 4 KB Sun Aug 30 10:48:27 2020 .
drwxrwxr-x joesan joesan 4 KB Sun Aug 30 10:48:10 2020 ..
.rw-rw-r-- joesan joesan 98 B Sun Aug 30 10:48:27 2020 .catkin_workspace
drwxrwxr-x joesan joesan 4 KB Sun Aug 30 10:48:27 2020 build
drwxrwxr-x joesan joesan 4 KB Sun Aug 30 10:48:26 2020 devel
drwxrwxr-x joesan joesan 4 KB Sun Aug 30 12:13:50 2020 src
joesan#joesan-InfinityBook-S-14-v5:~/Projects/Private/ros-projects/catkin_ws$
I have sourced this location in the .bash_profile as below:
# Dynamically source all setup.bash files from multiple catkin ros workspaces
find /home/joesan/Projects/Private/ros-projects -wholename '*/devel/setup.bash' | xargs source
I then source the .bash_profile from within my .bashrc
Now, when I tried to open the project in CLion, I see the following error:
CMake Error at CMakeLists.txt:65 (message):
find_package(catkin) failed. catkin was neither found in the workspace nor
in the CMAKE_PREFIX_PATH. One reason may be that no ROS setup.sh was
sourced before.
I launch CLion via a Desktop shortcut entry that I created. How do I make CLion aware of this .bash_profile such that it can find catkin?
I managed to fix this by doing the following, but make sure that you have a Desktop entry created for Jetbrains CLion beforehand!
Open the jetbrains-clion.desktop located in the .local folder:
~/.local/share/applications/jetbrains-clion.desktop
In this desktop entry, modify the Exec= line as:
Exec=bash -i -c "/opt/softwares/clion-2020.2.1/bin/clion.sh" %f
I'm trying to make a Go app using the (unoffical) Standard Go Project Layout. What I don't understand is how I should import the packages in the internal directory.
This is my project
Using the Dockerfile, which copies the internal directory to the $GOPATH, it works:
~/go/src/project-layout$ docker build --no-cache .
(...)
Step 5/7 : RUN ls -la /go/src
---> Running in a27235b0bbef
total 24
drwxrwxrwx 1 root root 4096 Apr 29 07:05 .
drwxrwxrwx 1 root root 4096 Apr 12 22:23 ..
-rw-rw-r-- 1 root root 556 Apr 29 06:06 README.md
drwxrwxr-x 3 root root 4096 Apr 29 06:08 app
drwxr-xr-x 1 root root 4096 Apr 29 07:05 myproject
drwxrwxr-x 3 root root 4096 Apr 29 06:11 pkg
Removing intermediate container a27235b0bbef
---> bb924f8f88f0
Step 6/7 : RUN go build -o myapp ./cmd/myapp/main.go
---> Running in 06bd6cd778d2
Removing intermediate container 06bd6cd778d2
---> 31184f9224c8
Step 7/7 : RUN ./myapp
---> Running in baf75d4dd503
Hello World, from myapp main
Hello world, from myapp internals
Hello world, from myprivatelib: 'myapp internal'
Hello world, from myprivatelib: 'myapp main'
Removing intermediate container baf75d4dd503
---> 5747b6b4686f
Successfully built 5747b6b4686f
However, when I try to build locally, I get:
~/go/src/project-layout$ go build -o myapp ./cmd/myapp/main.go
cmd/myapp/main.go:6:2: cannot find package "app/myapp" in any of:
/home/comavn/go/src/project-layout/vendor/app/myapp (vendor tree)
/usr/lib/go-1.10/src/app/myapp (from $GOROOT)
/home/comavn/go/src/app/myapp (from $GOPATH)
cmd/myapp/main.go:7:2: cannot find package "pkg/myprivatelib" in any of:
/home/comavn/go/src/project-layout/vendor/pkg/myprivatelib (vendor tree)
/usr/lib/go-1.10/src/pkg/myprivatelib (from $GOROOT)
/home/comavn/go/src/pkg/myprivatelib (from $GOPATH)
I can get it to work by symlinking internal/app and internal/pkg in the vendor directory, but that seems wrong...
So, what am I doing wrong here? How should I import these internal packages?
I think I found the proper solution: https://github.com/ComaVN/project-layout/commit/6415a8f06dd7fbdcf1c7282bc3ec172c3e145611
You have to import using the project name as well:
import (
"project-layout/internal/app/myapp"
"project-layout/internal/pkg/myprivatelib"
)
Unfortunatly, this does mean that the build depends on the exact directory name used for the project.
I went downloaded the Apktools from the website and got 2 files: Apktool.txt and Apktool_2.2.2. I renamed the Apktool_2.2.2 to Apktools.jar per the instructions. I then went to terminal and this was what I did:
Last login: Fri Mar 17 12:08:55 on ttys000
Roberts-MBP:~ Robert$ cd documents
Roberts-MBP:documents Robert$ cd metronomeapp/apktool
Roberts-MBP:apktool Robert$ **java -jar apktool.jar**
Apktool v2.2.2 - a tool for reengineering Android apk files
with smali v2.1.3 and baksmali v2.1.3
Copyright 2014 Ryszard Wiśniewski <brut.alll#gmail.com>
Updated by Connor Tumbleson <connor.tumbleson#gmail.com>
usage: apktool
-advance,--advanced prints advance information.
-version,--version prints the version then exits
usage: apktool if|install-framework [options] <framework.apk>
-p,--frame-path <dir> Stores framework files into <dir>.
-t,--tag <tag> Tag frameworks using <tag>.
usage: apktool d[ecode] [options] <file_apk>
-f,--force Force delete destination directory.
-o,--output <dir> The name of folder that gets written. Default is apk.out
-p,--frame-path <dir> Uses framework files located in <dir>.
-r,--no-res Do not decode resources.
-s,--no-src Do not decode sources.
-t,--frame-tag <tag> Uses framework files tagged by <tag>.
usage: apktool b[uild] [options] <app_path>
-f,--force-all Skip changes detection and build all files.
-o,--output <dir> The name of apk that gets written. Default is dist/name.apk
-p,--frame-path <dir> Uses framework files located in <dir>.
For additional info, see: http://ibotpeaches.github.io/Apktool/
For smali/baksmali info, see: https://github.com/JesusFreke/smali
Roberts-MBP:apktool Robert$ **./apktool d metronome.apk**
-bash: ./apktool: No such file or directory
Roberts-MBP:apktool Robert$ **apktool d metronome.apk**
-bash: apktool: command not found
Roberts-MBP:apktool Robert$
You can see in the bold what I entered. On the 2nd and 3rd bold statements, I did it both ways because I found info that one of them works on windows and one on mac and since the mac one didn't work I wanted to try the windows one to see what it would say. Both the files are in the same directory with the apk file (metronome.apk) Does anyone know why this isn't working and what I can do to resolve it?
Thanks.
Robert
Try java -jar apktool.jar d metronome.apk
To elaborate, apktool.jar is not a command itself. It's a java Jar file that can be executed by the Java runtime.
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 11 years ago.
PROBLEM IS SOLVED!
Follow the instructions Dons posted here
Open your environment variables (My Computer -> Properties (in the context menu) -> Advanced)
Add to or make a new environment variable C_INCLUDE_PATH so it points to MPI's include directory. In my case, /c/program files/mpich2/include.
Add to or make a new environment variable LIBRARY_PATH so it points to MPI's lib directory. In my case, /c/program files/mpich2/lib
Hide libmpi.a somehow. If need be, you can fix this later. It is a hack but you cannot build haskell-mpi without doing it because ld will fail. I renamed it to _libmpi.a
Now haskell-mpi should build on windows. Anticipating more trouble down the line, but it built, and it solved my problem.
I am wanting to use haskell-mpi on a lab machine at one of my university labs to do my final project for my parallel computing class, but I am running into trouble trying to get haskell-mpi to build against MPICH2.
haskell-mpi is pretty much completely undocumented, and digging through their git repository has helped me program some example programs on it but has done nothing to help me set it up on Windows. On my personal linux system, I had no trouble setting up and running haskell-mpi against MPICH2.
The problem is probably in one of cabal, the way MPICH2 is installed, or with haskell-mpi's cabal configuration, hence the choice of tags.
I am open to experimenting here for the sake of troubleshooting, and adding more information as needed, but eventually I will no longer have access to these machines.
I have administrator rights in the lab where I will be running this, so if the problem is with the MPICH2 installation itself, I could indeed reinstall it.
cabal fails as follows when I try to install haskell-mpi:
Resolving dependencies...
Configuring haskell-mpi-1.0.0...
cabal: Missing dependency on a foreign library:
* Missing C library: mpi
This problem can usually be solved by installing the system package that
provides this library (you may need the "-dev" version). If the library is
already installed but in a non-standard location then you can use the flags
--extra-include-dirs= and --extra-lib-dirs= to specify where it is.
cabal: Error: some packages failed to install:
haskell-mpi-1.0.0 failed during the configure step. The exception was:
ExitFailure 1
Here are what I tried giving for --extra-lib-dirs and --extra-include-dirs:
--extra-lib-dirs="C:\Program Files\MPICH2\lib"
--extra-include-dirs="C:\Program Files\MPICH2\include"
I've tried reordering where I put those flags, escaping the backlashes, using the short path PROGRA~1 and various permutations of these. So I don't think this is going to help. I need to know what the mpi dependency actually means and figure out how I will satisfy it so that this library can actually build. Here is what lives in the two aforementioned folders at this moment:
Libs:
Volume in drive C has no label.
Volume Serial Number is 5406-5C5C
Directory of C:\Program Files\MPICH2\lib
04/22/2011 01:20 PM <DIR> .
04/22/2011 01:20 PM <DIR> ..
01/31/2011 03:59 PM 515,704 cxx.lib
01/31/2011 04:23 PM 137,434 fmpich2.lib
01/31/2011 04:25 PM 410,982 fmpich2g.lib
01/31/2011 04:29 PM 162,690 fmpich2s.lib
01/31/2011 04:53 PM 0 libfmpich2g.a
01/31/2011 04:53 PM 0 libmpi.a
01/31/2011 04:53 PM 215,528 libmpicxx.a
01/31/2011 04:16 PM 10,618 mpe.lib
01/31/2011 04:46 PM 135,434 mpi.lib
9 File(s) 1,588,390 bytes
2 Dir(s) 221,505,835,008 bytes free
Include:
Volume in drive C has no label.
Volume Serial Number is 5406-5C5C
Directory of C:\Program Files\MPICH2\include
02/01/2011 05:38 PM <DIR> .
02/01/2011 05:38 PM <DIR> ..
11/17/2009 09:46 PM 4,857 clog_commset.h
11/02/2007 05:50 PM 696 clog_const.h
01/31/2011 03:50 PM 731 clog_inttypes.h
11/17/2009 09:46 PM 1,353 clog_uuid.h
10/21/2010 01:20 PM 355 mpe.h
11/17/2009 09:46 PM 11,102 mpe_log.h
11/02/2007 05:50 PM 1,833 mpe_logf.h
11/17/2009 09:46 PM 1,322 mpe_misc.h
01/31/2011 03:50 PM 57,128 mpi.h
01/31/2011 04:23 PM 3,251 mpi.mod
01/31/2011 03:50 PM 97,267 mpicxx.h
01/31/2011 03:51 PM 19,051 mpif.h
01/31/2011 03:50 PM 16,765 mpio.h
01/31/2011 04:23 PM 13,668 mpi_base.mod
01/31/2011 04:23 PM 30,866 mpi_constants.mod
01/31/2011 04:23 PM 7,802 mpi_sizeofs.mod
16 File(s) 268,047 bytes
2 Dir(s) 221,505,830,912 bytes free
Is there anything here that might be recognizably missing?
I am quite stumped at this point. Just about any suggestion would be helpful.
Sincerely, Barend.
PS: This should probably be tagged "haskell-mpi", but I'm not allowed to make new tags. I guess nobody else is really using it yet.
EDIT: Following Dons' suggestion,
I installed MingGW and MSYS. After running mingw-get update, I used mingw32-get to retrieve libtools, mingw32-utils, and mingw32-binutils. I set the following environment variables for the whole system using the Windows configuration GUI:
LIBRARY_PATH="C:\Program Files\MPICH2\lib"
C_INCLUDE_PATH="C:\Program Files\MPICH2\include"
echo $LIBRARY_PATH and echo %LIBRARY_PATH% now both work as expected, no surprises there. The environment variables are set. Making progress.
cabal install haskell-mpi still produces the same output it did before.
Played with ld for a long time, huge red herring...
I had to hide libmpi.a from ld to get it to work, but haskell-mpi now builds!
Putting step by step details at the top.
I need to know what the mpi dependency actually means
The line extra-libraries: mpi means that Cabal will add -lmpi to the ld linker options. In addition, tools that process headers will search in the include paths.
So, how do we help GHC and binutils find that library?
According to the wiki, assuming you have mingw or msys,
If you need to link to C-software, define an environment variable C_INCLUDE_PATH that lists the directories where the header files can be found. For linking the libraries you need to define an environment variable LIBRARY_PATH as well, listing the directories where .a and .lib files can be found.
So try setting the paths to include the path to the headers and libraries.