PDA

View Full Version : Does anyone have the knowledge and toolchain to build from source?



ReneMiner
20-02-2024, 19:02
I will not start long discussion, i am interested in
https://github.com/PCRE2Project/pcre2

an incredible regex-parser that goes in less than 2 seconds through all file of José Rocas PB-includes and presents me then accordingto my regex like all equate assignments, all udts, functio declarations classes etc. And thats only with PCRE2GREP - a commandline-tool.
It provides also all sources to build a library inclusing a jit-regex-compiler and now there is a new versaion out since a couple of weeks.

The link on the site that says "if you just want a version of the binaries " (some RexEgg.page) did not build any new version since 2021 and
that has a poblem to pick files because it only works with commandline-wildcards * and ? and is not really helpful but my idea is to run like




Shell_CaptureOutput( "%comspec% /c Dir /a:-D /b /s *.* >files.txt", "", %SW_Hide, 100)


then is can pass the name of files.txt that holds all subdirs and filenames from the "root" where i launched it
and i let PCRE2GREP pick from these names using a regex-pattern so i have the missing functionality .

Anyway i tried a lot using CMake, Cygwin and other funny stuff thats not really funny when you don't know what you are doing and it's
all just guessing and no idea where is the problem - why does it not build it?

If anyone could... the PCRE2Grep is currently the major object of interest but it were also nice to integrate the library as a module.
I am not firm using C, C# nor C++ but somehow i could get it transformed via powerbasic if it were a dll that contains exactly what the _ hell yeah . kilometers of docs by Philip Hazel (the author of that library). He is a retired Professor (guess informatics) at Cambridge University (GB) he knows how to operate linux or computers without any OS but nothing about building on windows and can not help

ReneMiner
27-02-2024, 12:23
Anyone? Please...

ErosOlmi
28-02-2024, 08:05
Ciao Rene,

always difficult to compile a C / C++ projects especially if it were developed for *nix first or * only

In the past I had some success compiling CJSon sources from https://github.com/DaveGamble/cJSON using Pelles C Compiler from http://www.smorgasbordet.com/pellesc/
After I got how to setup a Pelles C project it was easy but only because CJSon sources are well organized/written and not too much complex.

Otherwise I choose C/C++ projects to look/study only if they have a native Visual Studio Project or Solution.
In that case most of the cases it is easy to compile and test.

The library you mentioned seems quite complex in terms of compilation.
It seems *nix only and very few mention on how to compile under Windows

If I will have some time I will study it better reading all readme and docs regarding on how to make it.

Eros

ReneMiner
29-02-2024, 11:44
Visual Studio?
Someone prepared the make
For that https://github.com/kiyolee/pcre2-win-build/blob/main/README.pcre2

I don't have a visual studio because it's no real basic

ErosOlmi
04-03-2024, 20:45
This is a C library, you need some C compiler to compile the DLL
In this case the authors have already created a Visual Studio Solution from VS2010 to VS2022 and seem easy to compile it.

So the way to go is the following:

download and install Visual Studio 2022 Community Edition from Microsoft. It is free
When installing, be sure to install all C/C++ compiler options. DO not install all, can be massive! Install only C/C++
You can change later using Visual Studio Installer if you forgot or need something else


Once done:

Download the project into a folder
Open pcre2-win-build-main\build-VS2022\ folder
there is a pcre2.sln solution file, open it in Visual Studio 2022
change build type to "Release" and "Wind32"
from Build menu Build the library
See attached image where I've compiler the library


If all will go fine, you will have your DLL in a folder depending on how you compiled the library, in my case \pcre2-win-build-main\build-VS2022\Release\ I have libpcre2-32.dll DLL that I attach

Now you have to create some Basic Language Declare file in order to use DLL exported functions.
You need to study source, find exported functions, see what parameters they require and create some Declare ...

I suggest to use CFF Explorer. It helps to see which functions a DLL is exporting
See Image. You can find it here: https://ntcore.com/?page_id=345

Let me know
Seems a little bit complicated from a BASIC point of view :(

primo
04-03-2024, 21:08
i was preparing to post my experement here when Eros post his dll. here is my description
i have used vc++2010 express to build the pcre2.sln in build-VS2010 folder, and albeit many errors it build pcre2.sdf with size 30MB the file type is SQL Server Compact Edition Database File
i have double clicked on it and here is its screen
it is grepwin
10340
i guess compile the build-VS2022 which needs vs 2022 will produce the latest version which may be related to pcre2
the exe's can be found here https://sourceforge.net/projects/grepwin/
the source code is here
https://github.com/stefankueng/grepWin
but i don't see any reference to pcre2
while the https://github.com/kiyolee/pcre2-win-build declare that this is pcre2 for windows and as i have found it builds grepwin
it needs sherlock holmes to solve haha
try latest version grepWin-2.0.15 from source forge and see if it is compatible with pcre2

jack
06-03-2024, 01:08
hello ReneMiner :)
I built pcre2-10.43 that you linked in first post

jack
06-03-2024, 01:10
ReneMiner, let me know if there are any missing dll's

jack
06-03-2024, 01:20
here's the pcre2-win-build-10.43 64-bit, if you want the 32-bit let me know

primo
07-03-2024, 07:56
thanks jack for the valuable files you have posted.
what is the source for the last file pcre2-win-build-10.43 is it what is in pcre2 author site ?:
https://github.com/PCRE2Project/pcre2
whcih is the compiler used to compile it is it VS ? thank you

jack
07-03-2024, 09:01
hello primo
the Windows build source is from https://github.com/kiyolee/pcre2-win-build/tree/main I used VS 2022
btw, if you are interested in using the pcre2 library you may want to take a look at the FreeBASIC example that's included in it's distribution, you will find the example in examples\regex\PCRE

ReneMiner
07-03-2024, 19:01
Hi Jack, thanks a lot i will test it in a moment

for working with tb the 32-bit version of pcre2grep will serve at the moment to produce a tool to use from thinAir (commandline with some UI-wrapper)

After some more detailled study i will find out if (32 bit of course) can be implemented to become a module for tb to use the regEx from script.

jack
07-03-2024, 20:52
hello ReneMiner
here's the 32-bit version of pcre2-win-build-10.43