Skip to content

Missing ucrt64 library in resources --> Error in OpenModelica v1.24.3 (64-bit) - Windows 11#7

Open
NTedjosantoso wants to merge 2 commits intotbeu:mainfrom
NTedjosantoso:main
Open

Missing ucrt64 library in resources --> Error in OpenModelica v1.24.3 (64-bit) - Windows 11#7
NTedjosantoso wants to merge 2 commits intotbeu:mainfrom
NTedjosantoso:main

Conversation

@NTedjosantoso
Copy link
Copy Markdown

Related to modelica-3rdparty/ExternData#57

fixed by adding a minimal makefile for ucrt64 (using gcc in windows 11).
And then making the library.

Add simplified makefile for ucrt64
@tbeu
Copy link
Copy Markdown
Owner

tbeu commented Mar 31, 2026

Thanks for the PR.

There should be no reason to touch TARGETDIR as it can be set via command line, e.g. make TARGETDIR="ucrt64"

Do you run make from MSYS2 or Git Bash?

Can you test the following revised Makefile for gcc?

CC ?= cc
AR = ar -ru
RM = rm -f

TARGETDIR ?= linux64
BUILDDIR ?= build

OBJDIR := $(BUILDDIR)/obj
LIBDIR := $(BUILDDIR)/lib

INSTALLDIR := ../../Library/$(TARGETDIR)

CFLAGS = -O3 -Wno-attributes -fno-delete-null-pointer-checks -fPIC
CPPFLAGS = -DNDEBUG -DHAVE_UNISTD_H -DHAVE_STDARG_H -DHAVE_HIDDEN -DHAVE_MEMCPY
INC = -I"../../C-Sources/parson"

SRC := ../../C-Sources
PARSONSRC := $(SRC)/parson

TABLES_OBJS = \
	$(OBJDIR)/ModelicaTableAdditions.o \
	$(OBJDIR)/ModelicaTableAdditionsUsertab.o

IO_OBJS = \
	$(OBJDIR)/ModelicaIOAdditions.o

PARSON_OBJS = \
	$(OBJDIR)/parson.o

LIBS = \
	$(LIBDIR)/libModelicaTableAdditions.a \
	$(LIBDIR)/libModelicaIOAdditions.a \
	$(LIBDIR)/libparson.a

.PHONY: all install clean

all: $(LIBS)

install: all | $(INSTALLDIR)
	cp $(LIBDIR)/*.a $(INSTALLDIR)/

clean:
	$(RM) -r $(BUILDDIR)

$(OBJDIR) $(LIBDIR) $(INSTALLDIR):
	mkdir -p $@

$(LIBDIR)/libModelicaTableAdditions.a: $(TABLES_OBJS) | $(LIBDIR)
	$(AR) $@ $^

$(LIBDIR)/libModelicaIOAdditions.a: $(IO_OBJS) | $(LIBDIR)
	$(AR) $@ $^

$(LIBDIR)/libparson.a: $(PARSON_OBJS) | $(LIBDIR)
	$(AR) $@ $^

$(OBJDIR)/%.o: $(SRC)/%.c | $(OBJDIR)
	$(CC) $(CPPFLAGS) $(CFLAGS) $(INC) -c -o $@ $<

$(OBJDIR)/%.o: $(PARSONSRC)/%.c | $(OBJDIR)
	$(CC) $(CPPFLAGS) $(CFLAGS) $(INC) -c -o $@ $<

$(OBJDIR)/ModelicaTableAdditions.o: $(SRC)/ModelicaTableAdditions.c | $(OBJDIR)
	$(CC) $(CPPFLAGS) -DTABLE_SHARE=1 $(CFLAGS) $(INC) -c -o $@ $<

$(OBJDIR)/ModelicaTableAdditionsUsertab.o: $(SRC)/ModelicaTableAdditionsUsertab.c | $(OBJDIR)
	$(CC) $(CPPFLAGS) -DDUMMY_FUNCTION_USERTAB $(CFLAGS) $(INC) -c -o $@ $<

It can be called like this, e.g. from folder ModelicaTableAdditions/ModelicaTableAdditions/Resources:

tbeu@LAPTOP:/home/tbeu/ModelicaTableAdditions/ModelicaTableAdditions/Resources> CC=gcc-4.8 make install -C BuildProjects/gcc CFLAGS="-O3 -Wno-attributes -fno-delete-null-pointer-checks -fPIC" CPPFLAGS="$CPPFLAGS" TARGETDIR="linux64" BUILDDIR="../../build"

@NTedjosantoso
Copy link
Copy Markdown
Author

NTedjosantoso commented Mar 31, 2026

Hi thanks for the reply.

This is mainly due to my super limited knowledge of makefile and make in general.
As i only tried these on windows 11 cmd (to run make), i adjusted the rm and cp command to make ot work on my end.

I will try the things you mention and share the results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants